From f38134e44d04e18da5a7765397938e6fb806bac9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2020 12:42:34 +0100 Subject: [PATCH] Fix non transversable var --- htdocs/product/card.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9c315591903..7953bddb2fd 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1601,8 +1601,10 @@ else $c = new Categorie($db); $cats = $c->containing($object->id, Categorie::TYPE_PRODUCT); $arrayselected = array(); - foreach ($cats as $cat) { - $arrayselected[] = $cat->id; + if (is_array($cats)) { + foreach ($cats as $cat) { + $arrayselected[] = $cat->id; + } } print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%'); print "";