Problem/Motivation
Following #3538360: Profile & Instance naming normalization
In Profile entity & ProfileForm, we have enable property.
This may be wrong for 2 reasons:
- it must be "enabled" instead of "enable" because it is a status and not an action
- In Drupal Core, there is only one plugin with this mechanism and it is using
status boolean property instead:
$ grep -A 1 -r '$enabled' web/core/lib/Drupal/Core/*/Attribute
$ grep -A 1 -r '$enabled' web/core/modules/*/src/Attribute
$ grep -A 1 -r '$status' web/core/lib/Drupal/Core/*/Attribute
$ grep -A 1 -r '$status' web/core/modules/*/src/Attribute
web/core/modules/filter/src/Attribute/Filter.php: * @param bool $status
web/core/modules/filter/src/Attribute/Filter.php- * (optional) Whether this filter is enabled or disabled by default.
Proposed resolution
Renaming may not be enough. We also need to check if we can leverage existing mechanisms related to the standard status property (used in many config entities: Action, Date, Menu, Views, Search page, View mode, Language...) and simplify our code.
Comments
Comment #2
mogtofu33 commentedComment #3
smovs commentedComment #4
pdureau commentedComment #6
pdureau commentedI am not sure backward compatibility with "status" is expected because we are still in alpha phase and not commited yet to storage stability.
Comment #7
smovs commentedHi team!
I renamed "Enable" to "Enabled".
Also, I added code to allow compatibility with the old name. This is temporary and needs to be removed later.
Please review MR
Comment #8
pdureau commentedHI @smovs,
Thanks for you MR. 2 feedbacks:
Those 2 feedbacks are open to discussion if needed ;)
Comment #9
smovs commentedRefactored MR according to the suggestions. Please review
Comment #10
pdureau commentedLooks good to me
Comment #11
mogtofu33 commentedPlaywright test failing seems to show a PHP error, need to investigate.
Rebase is a bit tricky, could you do it or create an other squashed branch?
Comment #12
mogtofu33 commentedComment #13
smovs commentedComment #14
smovs commentedIndeed, I missed an issue in the ComponentLibraryPanel when I renamed 'status' to 'component_status'.
Thanks @mogtofu33, for noticing this issue.
I fixed it and also fixed merge conflicts with 1.0.x branch.
Please review
Comment #15
pdureau commentedComment #17
mogtofu33 commented