From dbb22b6f795f454742fbaff473a17c42272252c4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 20 Feb 2014 09:34:36 +0000 Subject: [PATCH] restoring value at end of etemplate::show_cell() as it is a reference into content and some widgets (IP-address cf) rely on being able so set content while using multiple widgets with same name relys on it being unchanged --- etemplate/inc/class.etemplate.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index 7508468b6d..124247e019 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -1082,6 +1082,7 @@ class etemplate extends boetemplate } $form_name = self::form_name($cname,$name); $value =& $this->get_array($content,$name); + $old_value = $value; // remember value to be able to restore it $options = ''; if ($readonly = $cell['readonly'] && $readonlys[$name] !== false || // allow to overwrite readonly settings of a cell @$readonlys[$name] && !is_array($readonlys[$name]) || $readonlys['__ALL__'] && (!is_string($name) || $readonlys[$name] !== false) || @@ -1892,6 +1893,10 @@ class etemplate extends boetemplate self::$request->unset_to_process($form_name); self::$request->set_to_process($form_name,'ext-'.$ext_type,$to_process); } + // restoring value, as it is a reference into content + // some widgets change it and rely on it being a reference + // using same name for multiple widgets breaks, if we dont restore it now + $value = $old_value; // save blur-value to strip it in process_exec if (!empty($blur) && self::$request->isset_to_process($form_name)) {