If a permission's machine name is the same as its module's machine name, the Extend UI is visually broken

Created on 20 January 2017, over 7 years ago
Updated 12 May 2023, about 1 year ago

Problem/Motivation

Hello,

We can't use the same name for the module and a permission, It visually breaks the Extend UI.

Steps to reproduce

- Create a module named 'Hello' with all necessary (hello.info.yml etc...),

- create a permission file 'hello.permissions.yml' with this

hello:
  title: 'Access hello'
  description: 'Permission to access Hello'
  restrict access: 'true'

- Go to /admin/people/permissions and search your permission : The displayed table is broken

Proposed resolution

Add a prefix "module_" before the $provider in $form['permissions'][$provider] in order to avoid using the same name for the module and permission:
$form['permissions']['module_' . $provider]

Remaining tasks

- Add a test
- Review
- Commit

User interface changes

Existing UI:

Proposed UI:

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

10.1

Component
Extension 

Last updated 3 days ago

No maintainer
Created by

🇫🇷France LG666

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024