DirectorObjectForm: normalize command field values...
...with special data types even when filled at services level fixes #12400 fixes #11692 fixes #11477
This commit is contained in:
parent
5355558519
commit
77c915c897
|
@ -300,19 +300,21 @@ abstract class DirectorObjectForm extends QuickForm
|
|||
|
||||
// Get value through form element.
|
||||
// TODO: reorder the related code. Create elements once
|
||||
if (property_exists($fields, $mykey)) {
|
||||
$field = $fields->$mykey;
|
||||
$datafield = DirectorDatafield::load($field->datafield_id, $this->getDb());
|
||||
$name = 'var_' . $datafield->varname;
|
||||
$className = $datafield->datatype;
|
||||
foreach (array($fields, $checkFields) as $fieldSet) {
|
||||
if (property_exists($fieldSet, $mykey)) {
|
||||
$field = $fieldSet->$mykey;
|
||||
$datafield = DirectorDatafield::load($field->datafield_id, $this->getDb());
|
||||
$name = 'var_' . $datafield->varname;
|
||||
$className = $datafield->datatype;
|
||||
|
||||
if (class_exists($className)) {
|
||||
$datatype = new $className;
|
||||
$datatype->setSettings($datafield->getSettings());
|
||||
$el = $datatype->getFormElement($name, $this);
|
||||
if (class_exists($className)) {
|
||||
$datatype = new $className;
|
||||
$datatype->setSettings($datafield->getSettings());
|
||||
$el = $datatype->getFormElement($name, $this);
|
||||
}
|
||||
|
||||
$value = $el->setValue($value)->getValue();
|
||||
}
|
||||
|
||||
$value = $el->setValue($value)->getValue();
|
||||
}
|
||||
|
||||
if (property_exists($fields, $mykey) && $fields->$mykey->format === 'json') {
|
||||
|
|
Loading…
Reference in New Issue