From 3c58ef8473f0b0027ec123ecea0a00dcfceda954 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 27 Aug 2010 16:11:02 +0000 Subject: [PATCH] fixed historylog widget shows "unknow type" for selectboxes with explicit options containing key 0 --- etemplate/inc/class.boetemplate.inc.php | 11 +++++++++++ etemplate/inc/class.historylog_widget.inc.php | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.boetemplate.inc.php b/etemplate/inc/class.boetemplate.inc.php index a2a0e13c52..01deb420c1 100644 --- a/etemplate/inc/class.boetemplate.inc.php +++ b/etemplate/inc/class.boetemplate.inc.php @@ -478,6 +478,17 @@ class boetemplate extends soetemplate return (self::$extensions[$type] || $this->loadExtension($type,$ui)) && ($function == '' || self::$extensions[$type]->public_functions[$function]); } + + /** + * Check if we have a widget of type $type + * + * @param string $type + * @return boolean true widget exists, false unknow widget type + */ + public function widgetExists($type) + { + return isset(self::$types[$tpye]) || $this->haveExtension($type); + } /** * executes the pre_process-function of the extension $cell[type] diff --git a/etemplate/inc/class.historylog_widget.inc.php b/etemplate/inc/class.historylog_widget.inc.php index aa27a1b604..0a63d3571f 100644 --- a/etemplate/inc/class.historylog_widget.inc.php +++ b/etemplate/inc/class.historylog_widget.inc.php @@ -77,7 +77,8 @@ class historylog_widget $cell = etemplate::empty_cell($type,$cell['name'],array('readonly' => true,'size' => $options)); if (is_array($type)) { - if (isset($type[0])) // numeric indexed array --> multiple values of 1:N releation + if (isset($type[0]) && // numeric indexed array --> multiple values of 1:N releation + $tmpl->widgetExists($type[0])) { $cell['type'] = 'vbox'; $cell['size'] = '0,,0,0';