also implement r46958 server-side: get customfield_list to respect readonlys of single fields

This commit is contained in:
Ralf Becker 2014-05-16 09:29:10 +00:00
parent c3b7018916
commit ec667b9c41

View File

@ -313,6 +313,11 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
{ {
$field_settings = $customfields[$fname=substr($field,1)]; $field_settings = $customfields[$fname=substr($field,1)];
// check if single field is set readonly, used in apps as it was only way to make cfs readonly in old eT
if ($this->is_readonly($form_name != self::GLOBAL_ID ? $form_name : '', $field))
{
continue;
}
// run validation method of widget implementing this custom field // run validation method of widget implementing this custom field
$widget = $this->_widget($fname, $field_settings); $widget = $this->_widget($fname, $field_settings);
$widget->validate($cname, $expand, $content, $validated); $widget->validate($cname, $expand, $content, $validated);
@ -328,7 +333,9 @@ class etemplate_widget_customfields extends etemplate_widget_transformer
if (is_null($valid)) $valid = false; if (is_null($valid)) $valid = false;
//error_log(__METHOD__."() $form_name $field: ".array2string($value).' --> '.array2string($valid)); //error_log(__METHOD__."() $form_name $field: ".array2string($value).' --> '.array2string($valid));
} }
} elseif ($this->type == 'customfields-types') { }
elseif ($this->type == 'customfields-types')
{
// Transformation doesn't handle validation // Transformation doesn't handle validation
$valid =& self::get_array($validated, $this->id ? $form_name : $field, true); $valid =& self::get_array($validated, $this->id ? $form_name : $field, true);
if (true) $valid = $value_in; if (true) $valid = $value_in;