FormController is now responsible for purging data from the set (NO_SAVE_DATA)
This commit is contained in:
parent
ab24c547a2
commit
c485622f5b
|
|
@ -7,6 +7,7 @@ use Event;
|
|||
use Input;
|
||||
use Redirect;
|
||||
use Backend;
|
||||
use Backend\Classes\FormField;
|
||||
use Backend\Classes\ControllerBehavior;
|
||||
use October\Rain\Support\Util;
|
||||
use October\Rain\Router\Helper as RouterHelper;
|
||||
|
|
@ -687,7 +688,7 @@ class FormController extends ControllerBehavior
|
|||
) {
|
||||
$this->setModelAttributes($model->{$attribute}, $value);
|
||||
}
|
||||
else {
|
||||
elseif ($value !== FormField::NO_SAVE_DATA) {
|
||||
$model->{$attribute} = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -807,12 +807,7 @@ class Form extends WidgetBase
|
|||
$dotted = implode('.', $parts);
|
||||
|
||||
$widgetValue = $widget->getSaveData(array_get($data, $dotted));
|
||||
if ($widgetValue === FormField::NO_SAVE_DATA) {
|
||||
array_forget($data, $dotted);
|
||||
}
|
||||
else {
|
||||
array_set($data, $dotted, $widgetValue);
|
||||
}
|
||||
array_set($data, $dotted, $widgetValue);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue