Problem/Motivation
The path to the file:
web/core/recipes/example/recipe.yml
Below is a code snippet, with the invalid comment highlighted in bold:
# Configuration actions may be defined. The structure here should be
# entity_type.ID.action. Below the user role entity type with an ID of
# editor is having the permissions added. The permissions key will be
# mapped to the \Drupal\user\Entity\Role::grantPermission() method.
actions:
text.settings:
simpleConfigUpdate:
default_summary_length: 700
The comment above the actions section originally described a configuration related to user roles and permissions.
Original code:
# Configuration actions may be defined. The structure here should be
# entity_type.ID.action. Below the user role entity type with an ID of
# editor is having the permissions added. The permissions key will be
# mapped to the \Drupal\user\Entity\Role::grantPermission() method.
actions:
user.role.editor:
createIfNotExists:
label: 'Editor'
grantPermissions:
- 'delete any article content'
- 'edit any article content'However, in a later commit, the actual configuration changed to modifying text.settings, but the comment remained unchanged:
actions:
text.settings:
simpleConfigUpdate:
default_summary_length: 700Now, the comment is misleading because it's still describing user roles and permissions, while the actual code is updating text summary length settings.
Steps to reproduce
Proposed resolution
Correct the comment such that it describes the current code.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3496485
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:
- 3496485-example-recipe.yml-has
changes, plain diff MR !11181
Comments
Comment #2
wombatbuddy commentedComment #3
wombatbuddy commentedComment #4
wombatbuddy commentedComment #5
thejimbirch commentedWhy is it invalid?
Comment #6
annmarysruthy commentedThe comment above the actions section originally described a configuration related to user roles and permissions.
Original code:
However, in a later commit, the actual configuration changed to modifying text.settings, but the comment remained unchanged:
Now, the comment is misleading because it's still describing user roles and permissions, while the actual code is updating text summary length settings.
Comment #7
annmarysruthy commentedComment #9
annmarysruthy commentedComment #10
smustgrave commentedHave not reviewed
But should use complete issue summary.
Comment #11
annmarysruthy commentedUpdated issue summary
Comment #12
annmarysruthy commentedComment #13
thejimbirch commentedThis looks great. Thanks for the contribution!
Comment #14
quietone commented@annmarysruthy, thanks for doing the research on how the example changed. When doing that important work it helps the others working on the issue to add links to the previous issues and/or commits.
Using git I found that the change happened in #3447994: Example recipe isn't functional. And skimming that issue it looks like an oversight that this comment was not updated as well.
Comment #18
quietone commentedThe new text was not wrapped correctly at 80. I fixed that on commit using a PHPStorm plugin that does the wrapping for me.
Committed to 11.x and cherry-pick to 11.1.x
Thanks!