mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Allow removeField() on contextual field names (#790)
The addFields() method already filters out fields that don't match the current context. As such, the normalized field name should be used when adding the field to the tab containers instead of the name with the context included. This matches the definition in allFields.
This commit is contained in:
parent
f61da3e800
commit
864d3fbdcf
@ -736,13 +736,13 @@ class Form extends WidgetBase
|
||||
|
||||
switch (strtolower($addToArea)) {
|
||||
case FormTabs::SECTION_PRIMARY:
|
||||
$this->allTabs->primary->addField($name, $fieldObj, $fieldTab);
|
||||
$this->allTabs->primary->addField($fieldObj->fieldName, $fieldObj, $fieldTab);
|
||||
break;
|
||||
case FormTabs::SECTION_SECONDARY:
|
||||
$this->allTabs->secondary->addField($name, $fieldObj, $fieldTab);
|
||||
$this->allTabs->secondary->addField($fieldObj->fieldName, $fieldObj, $fieldTab);
|
||||
break;
|
||||
default:
|
||||
$this->allTabs->outside->addField($name, $fieldObj);
|
||||
$this->allTabs->outside->addField($fieldObj->fieldName, $fieldObj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user