Fixes the following error due to strict_types being enabled: PHP message: PHP Fatal error: Uncaught TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given diff --git a/ui/app/partials/service.list.edit.php b/ui/app/partials/service.list.edit.php index f761463..9bf13af 100644 --- a/ui/app/partials/service.list.edit.php +++ b/ui/app/partials/service.list.edit.php @@ -65,7 +65,7 @@ foreach ($data['services'] as $serviceid => $service) { if ($data['is_filtered']) { $parents = []; - foreach (array_slice($service['parents'], 0, $data['max_in_table']) as $parent) { + foreach (array_slice($service['parents'], 0, (int) $data['max_in_table']) as $parent) { if ($parents) { $parents[] = ', '; } @@ -82,7 +82,7 @@ foreach ($data['services'] as $serviceid => $service) { $root_cause = []; - foreach (array_slice($service['problem_events'], 0, $data['max_in_table']) as $problem_event) { + foreach (array_slice($service['problem_events'], 0, (int) $data['max_in_table']) as $problem_event) { if ($root_cause) { $root_cause[] = ', '; } diff --git a/ui/app/partials/service.list.php b/ui/app/partials/service.list.php index 4af0556..1ba799c 100644 --- a/ui/app/partials/service.list.php +++ b/ui/app/partials/service.list.php @@ -78,7 +78,7 @@ foreach ($data['services'] as $serviceid => $service) { $root_cause = []; - foreach (array_slice($service['problem_events'], 0, $data['max_in_table']) as $problem_event) { + foreach (array_slice($service['problem_events'], 0, (int) $data['max_in_table']) as $problem_event) { if ($root_cause) { $root_cause[] = ', '; }