diff --git a/etemplate/inc/class.select_widget.inc.php b/etemplate/inc/class.select_widget.inc.php index b1e40529dd..7973ba9cb4 100644 --- a/etemplate/inc/class.select_widget.inc.php +++ b/etemplate/inc/class.select_widget.inc.php @@ -187,7 +187,8 @@ class select_widget { $categories = new categories('',$type3); } - foreach((array)$categories->return_sorted_array(0,False,'','','',!$type,$type4) as $cat) + // we cast $type4 (parent) to int, to get default of 0 if omitted + foreach((array)$categories->return_sorted_array(0,False,'','','',!$type,(int)$type4) as $cat) { $s = str_repeat(' ',$cat['level']) . stripslashes($cat['name']);