From 084d14bbf7409c9f51b7c33de753f96cb01bd3de Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 12 Mar 2007 00:00:37 +0000 Subject: [PATCH] r1454: Encase the foreach() loop on components in ConstructProductSelect() so we don't get warnings --- includes/functions_product.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/functions_product.php b/includes/functions_product.php index 19f2708..c8b2500 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -40,9 +40,12 @@ function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsole // index all of the components by parent and ID $components = array(); - foreach ($bugsys->datastore['component'] AS $id => $prod) + if (is_array($bugsys->datastore['component'])) { - $components["$prod[parentid]"]["$id"] = $prod; + foreach ($bugsys->datastore['component'] AS $id => $prod) + { + $components["$prod[parentid]"]["$id"] = $prod; + } } // these are products -- 2.22.5