From b3f48920f976b37c7160aa94b7d8aeb6135fcb55 Mon Sep 17 00:00:00 2001 From: Rom1-B Date: Tue, 14 Oct 2025 09:17:10 +0200 Subject: [PATCH] Fix: foreach() argument must be of type array|object --- inc/container.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/inc/container.class.php b/inc/container.class.php index af804251..e6ccd70c 100644 --- a/inc/container.class.php +++ b/inc/container.class.php @@ -237,9 +237,13 @@ public static function installUserData(Migration $migration, $version) $obj = new self(); $containers = $obj->find(); foreach ($containers as $container) { - $itemtypes = !empty($container['itemtypes']) - ? json_decode($container['itemtypes'], true) - : []; + $itemtypes = []; + if (!empty($container['itemtypes'])) { + $decoded = json_decode($container['itemtypes'], true); + if (is_array($decoded)) { + $itemtypes = $decoded; + } + } foreach ($itemtypes as $itemtype) { $sysname = self::getSystemName($itemtype, $container['name']);