Permissions that depend on disabled modules prevent any editing/creation of other permissions

Created on 13 July 2022, over 2 years ago
Updated 1 August 2023, over 1 year ago

Steps to reproduce

  1. make sure that the dblog module is enabled
  2. head to admin/people/custom-permissions/list and add a custom permission called "Administer error logs" (or anything you find appropriate), with its route set to dblog.overview
  3. save the permission
  4. disable/uninstall the dblog module
  5. head back to admin/people/custom-permissions/list and try to adit any existing custom permission, or to add a new one, or even try to save the form without making any changes

The above results in an error message, and the form has inline errors in the "Administer error logs" custom permission, saying "The route dblog.overview is invalid."

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇦🇺Australia klonos 90% Melbourne, Australia - 10% Larissa, Greece

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • 🇮🇳India roshni27

    Please the patch.

  • Assigned to Kristen Pol
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    I'm going to make a release soon so looking at all recently fixed issues along with RTBC and needs review.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    This is a major (or perhaps even critical) issue as it prevents you from using the functionality.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Created an MR and changed the logic a bit to make it simpler to understand.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    I've reworked the logic during testing.

    Test 1

    • Go to /admin/people/custom-permissions/list
    • Click "Add permission"
    • Click "Save"
    • Result: no fatal error

    Test 2

    • Go to /admin/people/custom-permissions/list
    • Click "Add permission"
    • Duplicate an existing entry, e.g. "Administer account settings 2" and "entity.user.admin_form"
    • Click "Save"
    • Result: no fatal error
    • Delete the original entry name and route
    • Click "Save"
    • Result: no fatal error

    Test 3

    • Go to /admin/people/custom-permissions/list
    • Click "Add permission"
    • Fill in a name but no route
    • Click "Save"
    • Result: shows error about missing as expected
    • Fill in an invalid route but no name
    • Result: shows error about missing name as expected
    • Fill in an invalid route and a name
    • Result: shows error about invalid route as expected
    • Fill in an valid route and a name
    • Result: saved as expected
    • Click Delete link for new entry
    • Result: deletes as expected
  • @kirsten-pol your three tests pass on a default GovCMS installation (drupal 10.3).

    However, the issue originally reported by @klonos is still present for me, though I'm not actually sure its a bug. If the route dblog.overview is not present, yes you are prevented from editing or saving the custom permissions - but this is remedied (at least for me) by removing this route. This seems reasonable to me.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks.

    Maybe we need a clearer error message in that case?

Production build 0.71.5 2024