diff --git a/etemplate/inc/class.etemplate_widget_historylog.inc.php b/etemplate/inc/class.etemplate_widget_historylog.inc.php index 268b0381b9..eaf5f43547 100644 --- a/etemplate/inc/class.etemplate_widget_historylog.inc.php +++ b/etemplate/inc/class.etemplate_widget_historylog.inc.php @@ -29,27 +29,30 @@ class etemplate_widget_historylog extends etemplate_widget { $form_name = self::form_name($cname, $this->id); - foreach(self::$request->content[$form_name]['status-widgets'] as $key => $type) + if(is_array(self::$request->content[$form_name]['status-widgets'])) { - if(!is_array($type)) + foreach(self::$request->content[$form_name]['status-widgets'] as $key => $type) { - list($basetype) = explode('-',$type); - $widget = @self::factory($basetype, '<'.$type.' type="'.$type.'"/>', $key); - $widget->id = $key; - $widget->attrs['type'] = $type; - $widget->type = $type; - - if(method_exists($widget, 'beforeSendToClient')) + if(!is_array($type)) { - $widget->beforeSendToClient($cname); + list($basetype) = explode('-',$type); + $widget = @self::factory($basetype, '<'.$type.' type="'.$type.'"/>', $key); + $widget->id = $key; + $widget->attrs['type'] = $type; + $widget->type = $type; + + if(method_exists($widget, 'beforeSendToClient')) + { + $widget->beforeSendToClient($cname); + } } + else + { + if (!is_array(self::$request->sel_options[$key])) self::$request->sel_options[$key] = array(); + self::$request->sel_options[$key] += $type; + } + } - else - { - if (!is_array(self::$request->sel_options[$key])) self::$request->sel_options[$key] = array(); - self::$request->sel_options[$key] += $type; - } - } } } diff --git a/etemplate/inc/class.etemplate_widget_menupopup.inc.php b/etemplate/inc/class.etemplate_widget_menupopup.inc.php index 33d1c99dfa..9165bba469 100644 --- a/etemplate/inc/class.etemplate_widget_menupopup.inc.php +++ b/etemplate/inc/class.etemplate_widget_menupopup.inc.php @@ -376,10 +376,16 @@ class etemplate_widget_menupopup extends etemplate_widget } // Make sure all values are present, even if not normally sent (according to preferences) - $remaining = array_diff_key($value, $options); - foreach($remaining as $id) + if(is_array($value)) { - $options[$id] = !$id && !is_numeric($rows) ? lang($rows) : self::accountInfo($id,null,$type2,$type=='both'); + $remaining = array_diff_key($value, $options); + } + if(is_array($remaining)) + { + foreach($remaining as $id) + { + $options[$id] = !$id && !is_numeric($rows) ? lang($rows) : self::accountInfo($id,null,$type2,$type=='both'); + } } break;