Conversation
- Use TextCheckboxGroupField::create('Title') instead of ->setName('Title')
- This creates 'TitleShowTitle' field name naturally
- Ensures consistency with CustomStylesExtension positioning logic
- Part of unified approach across BaseElementObject descendants
There was a problem hiding this comment.
Pull Request Overview
This PR updates the BaseElementObject class to use natural field naming for the TextCheckboxGroupField by passing the field name directly to the create() method instead of using setName(). This change ensures the field name becomes TitleShowTitle naturally following SilverStripe framework behavior.
- Simplified field creation by passing field name to constructor
- Enables natural
TitleShowTitlefield naming for consistency with framework patterns - Part of coordinated update across multiple repositories for field positioning
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@muskie9, this is in relation to https://github.com/dynamic/silverstripe-essentials-tools/pull/46 Tagged you on the review in case you can think of scenarios where this would be a breaking change |
|
@jsirish It looks like v5 of this module may be used by some of our other newer sites so we may need to check how the fields are affected as those projects are updated over time. |
Summary
Updates
BaseElementObjectto use naturalTitleShowTitlefield naming by modifying theTextCheckboxGroupFieldcreation approach.Changes
TextCheckboxGroupField::create('Title')instead of->setName('Title')TitleShowTitlenaturally (SilverStripe framework behavior)Technical Details
Before
After
Integration Context
This change is part of a coordinated update with
CustomStylesExtensionin essentials-tools:CustomStylesExtensionto position fields usingTitleShowTitleforBaseElementObjectdescendants (PR #46)TitleShowTitlenaturallyNote: After investigation, carousel's
Slideclass was already using the correctTextCheckboxGroupField::create('Title')pattern, so no changes were needed there.Backwards Compatibility
TitletoTitleShowTitlefor BaseElementObject descendantsTesting
CustomStylesExtensionpositioning logicRelated Work