Adhere to best practices for getCMSFields()
across supported modules in CMS 6
#294
Labels
getCMSFields()
across supported modules in CMS 6
#294
As part of silverstripe/silverstripe-cms#2767, new best practices are established regarding the scaffolding of form fields for the CMS in CMS 6.
DataObject
subclasses should always callparent::getCMSFields()
in theirgetCMSFields()
method.mainTabOnly
to true in theirscaffold_cms_fields_settings
configtabbed
to false in theirscaffold_cms_fields_settings
configbeforeUpdateCMSFields()
should always be used, with the exception of changes to form fields that are explicitly not to be available in extensionsignoreRelations
andignoreFields
options inscaffold_cms_fields_settings
config should be used rather thanremoveByName()
I've taken a look and found the following in our supported modules where these best practices are not being followed:
Known to be avoiding
parent::getCMSFields()
:SilverStripe\Security\Group
SilverStripe\Assets\File
SilverStripe\Blog\Model\BlogObject
SilverStripe\SiteConfig\SiteConfig
SilverStripe\Subsites\Model\SubsiteDomain
SilverStripe\UserForms\Model\EditableFormField
SilverStripe\UserForms\Model\Recipient\EmailRecipient
SilverStripe\Versioned\ChangeSet
Symbiote\AdvancedWorkflow\DataObjects\WorkflowAction
Symbiote\AdvancedWorkflow\DataObjects\WorkflowDefinition
Symbiote\AdvancedWorkflow\DataObjects\WorkflowInstance
Symbiote\AdvancedWorkflow\DataObjects\WorkflowTransition
TractorCow\Fluent\Model\Domain
TractorCow\Fluent\Model\FallbackLocale
TractorCow\Fluent\Model\Locale
Known to not be using
beforeUpdateCMSFields()
:SilverStripe\Security\PermissionRole
SilverStripe\LDAP\Model\LDAPGroupMapping
SilverStripe\SpamProtection\EditableSpamProtectionField
Symbiote\AdvancedWorkflow\Actions\AssignUsersToWorkflowAction
Symbiote\AdvancedWorkflow\Actions\NotifyUsersWorkflowAction
Symbiote\AdvancedWorkflow\Actions\PublishItemWorkflowAction
Symbiote\AdvancedWorkflow\Actions\SetPropertyWorkflowAction
Symbiote\AdvancedWorkflow\Actions\UnpublishItemWorkflowAction
Symbiote\QueuedJobs\DataObjects\QueuedJobDescriptor
(also usingremoveByName()
instead ofscaffold_cms_fields_settings
config)Known to be using
removeByName()
when this could be configured usingscaffold_cms_fields_settings
config:SilverStripe\Security\Member
SilverStripe\LinkField\Models\EmailLink
SilverStripe\LinkField\Models\Link
SilverStripe\LinkField\Models\PhoneLink
SilverStripe\LinkField\Models\SiteTreeLink
SilverStripe\Subsites\Model\Subsite
SilverStripe\Taxonomy\TaxonomyTerm
SilverStripe\UserForms\Model\EditableFormField\EditableCountryDropdownField
SilverStripe\UserForms\Model\EditableFormField\EditableDropdown
SilverStripe\UserForms\Model\EditableFormField\EditableFieldGroup
SilverStripe\UserForms\Model\EditableFormField\EditableFieldGroupEnd
SilverStripe\UserForms\Model\EditableFormField\EditableFileField
SilverStripe\UserForms\Model\EditableFormField\EditableFormHeading
SilverStripe\UserForms\Model\EditableFormField\EditableFormStep
SilverStripe\UserForms\Model\EditableFormField\EditableLiteralField
SilverStripe\UserForms\Model\EditableFormField\EditableMemberListField
SilverStripe\UserForms\Model\EditableFormField\EditableRadioField
SilverStripe\UserForms\Model\Submission\SubmittedForm
DNADesign\Elemental\Models\BaseElement
Acceptance criteria
parent::getCMSFields()
is not called within agetCMSFields()
implementation in aDataObject
subclassDataObject::getCMSFields()
itself$this->beforeUpdateCMSFields()
is not called within agetCMSFields()
implementation in aDataObject
subclassDataObject::getCMSFields()
itselfremoveByName()
is being used instead ofscaffold_cms_fields_settings
configDataObject
andExtension
subclassesThe text was updated successfully, but these errors were encountered: