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: 700

Now, 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

Command icon 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:

Comments

wombatbuddy created an issue. See original summary.

wombatbuddy’s picture

Issue summary: View changes
wombatbuddy’s picture

Issue summary: View changes
wombatbuddy’s picture

Issue summary: View changes
thejimbirch’s picture

Why is it invalid?

annmarysruthy’s picture

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: 700

Now, the comment is misleading because it's still describing user roles and permissions, while the actual code is updating text summary length settings.

annmarysruthy’s picture

Assigned: Unassigned » annmarysruthy

annmarysruthy’s picture

Assigned: annmarysruthy » Unassigned
Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Have not reviewed

But should use complete issue summary.

annmarysruthy’s picture

Issue summary: View changes
Status: Needs work » Needs review

Updated issue summary

annmarysruthy’s picture

Issue summary: View changes
thejimbirch’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update

This looks great. Thanks for the contribution!

quietone’s picture

Title: example recipe.yml has invalid comment above "actions" section » example recipe.yml has incorrect comment above "actions" section
Related issues: +#3447994: Example recipe isn't functional

@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.

  • quietone committed d3b4dce5 on 11.1.x
    Issue #3496485 by annmarysruthy, wombatbuddy, thejimbirch, smustgrave:...

  • quietone committed 6dd918c9 on 11.x
    Issue #3496485 by annmarysruthy, wombatbuddy, thejimbirch, smustgrave:...

quietone’s picture

Version: 11.x-dev » 11.1.x-dev
Status: Reviewed & tested by the community » Fixed

The 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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.