From 0de1c5b69ddff24b845bbde3dd7538b0538b34db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Nov 2019 23:29:28 +0100 Subject: [PATCH] Update list.php Invalid argument supplied for foreach() in /htdocs/asset/list.php on line 410 --- htdocs/asset/list.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 8ea4f46c89d..11bb989a0ed 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -407,9 +407,13 @@ print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine=0; -foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) -{ - if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object +if (is_array($extrafields->attributes[$object->table_element]['computed'])) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + if (preg_match('/\$object/', $val)) { + // There is at least one compute field that use $object + $needToFetchEachLine++; + } + } }