Ignore disabled FormWidgets in getSaveData() (#4116)

Fixes #3983. Credit to @tmus.
This commit is contained in:
Tomy Smith 2019-03-19 22:45:32 +00:00 committed by Luke Towers
parent 5c15687032
commit 40bc6e0d67
1 changed files with 5 additions and 0 deletions

View File

@ -1182,6 +1182,11 @@ class Form extends WidgetBase
foreach ($this->formWidgets as $field => $widget) {
$parts = HtmlHelper::nameToArray($field);
if ((isset($widget->config->disabled) && $widget->config->disabled)
|| (isset($widget->config->hidden) && $widget->config->hidden)) {
continue;
}
$widgetValue = $widget->getSaveValue($this->dataArrayGet($result, $parts));
$this->dataArraySet($result, $parts, $widgetValue);
}