From cee12fd6a5b2d81c82f1e2d7d9f345d0670983c5 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 3 May 2022 13:44:08 +0200 Subject: [PATCH 1/2] Setup Wizard: Fix bool to int cast exception on first page fixes https://github.com/Icinga/icingaweb2/issues/4770 --- modules/setup/application/views/scripts/index/index.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/setup/application/views/scripts/index/index.phtml b/modules/setup/application/views/scripts/index/index.phtml index 3a6e17965..b2b3bda50 100644 --- a/modules/setup/application/views/scripts/index/index.phtml +++ b/modules/setup/application/views/scripts/index/index.phtml @@ -6,7 +6,7 @@ $pages = $wizard->getPages(); $finished = isset($success); $configPages = array_slice($pages, 3, count($pages) - 4, true); $currentPos = array_search($wizard->getCurrentPage(), $pages, true); -list($configPagesLeft, $configPagesRight) = array_chunk($configPages, count($configPages) / 2, true); +list($configPagesLeft, $configPagesRight) = array_chunk($configPages, (int)(count($configPages) / 2), true); $visitedPages = array_keys($wizard->getPageData()); $maxProgress = max(array_merge([0], array_keys(array_filter( From 48e96ba301493d51deb2d1e41d82d7a175c5b85b Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 3 May 2022 14:08:16 +0200 Subject: [PATCH 2/2] RequirementSet: Fix null returned instead int exception fixes #4767 --- modules/setup/library/Setup/RequirementSet.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/setup/library/Setup/RequirementSet.php b/modules/setup/library/Setup/RequirementSet.php index 4c5bb121a..672fad454 100644 --- a/modules/setup/library/Setup/RequirementSet.php +++ b/modules/setup/library/Setup/RequirementSet.php @@ -290,7 +290,7 @@ class RequirementSet implements RecursiveIterator */ public function valid(): bool { - return $this->key() !== null; + return key($this->requirements) !== null; } /**