Bug
This commit is contained in:
parent
ef2234c74b
commit
c044e63a07
|
|
@ -357,6 +357,26 @@ class Form extends WidgetBase
|
|||
$field->arrayName = $this->arrayName;
|
||||
$field->idPrefix = $this->getId();
|
||||
|
||||
/*
|
||||
* Simple widget field, only widget type is supplied
|
||||
*/
|
||||
if (is_string($config) && $this->isFormWidget($config) !== false) {
|
||||
$field->displayAs('widget', ['widget' => $config]);
|
||||
return $field;
|
||||
}
|
||||
/*
|
||||
* Simple field, only field type is supplied
|
||||
*/
|
||||
elseif (is_string($config)) {
|
||||
$field->displayAs($config);
|
||||
return $field;
|
||||
}
|
||||
|
||||
|
||||
$fieldType = isset($config['type']) ? $config['type'] : null;
|
||||
if (!is_string($fieldType) && !is_null($fieldType))
|
||||
throw new ApplicationException(Lang::get('backend::lang.field.invalid_type', ['type'=>gettype($fieldType)]));
|
||||
|
||||
/*
|
||||
* Process basic options
|
||||
*/
|
||||
|
|
@ -381,25 +401,6 @@ class Form extends WidgetBase
|
|||
*/
|
||||
$field->value = $this->getFieldValue($field);
|
||||
|
||||
/*
|
||||
* Simple widget field, only widget type is supplied
|
||||
*/
|
||||
if (is_string($config) && $this->isFormWidget($config) !== false) {
|
||||
$field->displayAs('widget', ['widget' => $config]);
|
||||
return $field;
|
||||
}
|
||||
/*
|
||||
* Simple field, only field type is supplied
|
||||
*/
|
||||
elseif (is_string($config)) {
|
||||
$field->displayAs($config);
|
||||
return $field;
|
||||
}
|
||||
|
||||
$fieldType = isset($config['type']) ? $config['type'] : null;
|
||||
if (!is_string($fieldType) && !is_null($fieldType))
|
||||
throw new ApplicationException(Lang::get('backend::lang.field.invalid_type', ['type'=>gettype($fieldType)]));
|
||||
|
||||
/*
|
||||
* Widget with options
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue