FIX Pass arrays to addFieldsToTab

This commit is contained in:
Steve Boyd 2024-05-13 19:22:24 +12:00
parent 179d1451e6
commit 796fffec4f
2 changed files with 4 additions and 4 deletions

View File

@ -318,14 +318,14 @@ class EditableFormField extends DataObject
// Validation
$validationFields = $this->getFieldValidationOptions();
if ($validationFields && $validationFields->count()) {
$fields->addFieldsToTab('Root.Validation', $validationFields);
$fields->addFieldsToTab('Root.Validation', $validationFields->toArray());
$fields->fieldByName('Root.Validation')->setTitle(_t(__CLASS__.'.VALIDATION', 'Validation'));
}
// Add display rule fields
$displayFields = $this->getDisplayRuleFields();
if ($displayFields && $displayFields->count()) {
$fields->addFieldsToTab('Root.DisplayRules', $displayFields);
$fields->addFieldsToTab('Root.DisplayRules', $displayFields->toArray());
}
// Placeholder

View File

@ -234,9 +234,9 @@ trait UserForm
->getComponentByType(GridFieldDetailForm::class)
->setItemRequestClass(UserFormRecipientItemRequest::class);
$fields->addFieldsToTab('Root.FormOptions', $onCompleteFieldSet);
$fields->addFieldToTab('Root.FormOptions', $onCompleteFieldSet);
$fields->addFieldToTab('Root.Recipients', $emailRecipients);
$fields->addFieldsToTab('Root.FormOptions', $this->getFormOptions());
$fields->addFieldsToTab('Root.FormOptions', $this->getFormOptions()->toArray());
$submissions = $this->getSubmissionsGridField();
$fields->findOrMakeTab('Root.Submissions')->setTitle(_t('SilverStripe\\UserForms\\Model\\UserDefinedForm.SUBMISSIONS', 'Submissions'));