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

This commit is contained in:
Ralf Becker 2014-02-20 09:34:36 +00:00
parent 035d5a934a
commit dbb22b6f79

View File

@ -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))
{