Problem/Motivation
If you apply a recipe which uses the addToAllBundles action but leave either the label or description, unset, there will be a warning message like Undefined array key "description" AddToAllBundles.php.
Proposed resolution
Set these by default to null.
Remaining tasks
Implement.
User interface changes
None except the warnings are not displayed.
Introduced terminology
None.
API changes
None.
Data model changes
None.
Release notes snippet
Issue fork drupal-3572679
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3572679-prevent-undefined-array
changes, plain diff MR !14722
Comments
Comment #3
liam morlandComment #4
sivaji_ganesh_jojodae commentedStraightforward fix.
Comment #5
phenaproximaNeither value can be NULL.
The label is required, per config schema: https://git.drupalcode.org/project/drupal/-/blob/main/core/config/schema...
And the description is of the
texttype, which is not nullable.Committing this as-is will generate broken configuration, and recipes that use this action will immediately break because the recipe system validates against config schema.
So what this really should look like is (pseudocode):
Also, we definitely need a test of this.
Comment #6
liam morlandI have implemented the changes in #5.
Comment #7
phenaproximaLooks good, but still needs a test. :)
Comment #8
liam morlandYes, that is why I left it at "needs work".
Comment #10
neptune-dc commentedAdded a test!
Comment #11
phenaproximaThanks, @neptune-dc! One question about the test, otherwise that's an easy RTBC from me.
Comment #12
liam morlandI have addressed the question by adding the ID.
Comment #13
phenaproximaShip it!
Comment #15
liam morlandWhy was the merge request closed?
Comment #19
godotislateCommitted b7fce18 and pushed to main, committed 5ef61a6 and pushed to 11.x, and committed 7d7980a and pushed to 11.3.x. Thanks!