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 "";