diff --git a/src/Forms/FieldList.php b/src/Forms/FieldList.php index 7e8a80cd1..85143cf13 100644 --- a/src/Forms/FieldList.php +++ b/src/Forms/FieldList.php @@ -3,6 +3,7 @@ namespace SilverStripe\Forms; use SilverStripe\ORM\ArrayList; +use SilverStripe\Dev\Deprecation; /** * A list designed to hold form field instances. @@ -218,6 +219,10 @@ class FieldList extends ArrayList */ public function addFieldsToTab($tabName, $fields, $insertBefore = null) { + if (!is_array($fields)) { + Deprecation::notice('5.3.0', '$fields will need to be passed as an array in CMS 6', Deprecation::SCOPE_METHOD); + } + $this->flushFieldsCache(); // Find the tab @@ -270,6 +275,10 @@ class FieldList extends ArrayList */ public function removeFieldsFromTab($tabName, $fields) { + if (!is_array($fields)) { + Deprecation::notice('5.3.0', '$fields will need to be passed as an array in CMS 6', Deprecation::SCOPE_METHOD); + } + $this->flushFieldsCache(); // Find the tab