When "Disable developer modules" is triggered, developer modules are disabled. Visiting and submitting the permissions form on admin/user/permissions will thereby remove all permissions of disabled developer modules.

Actually, this is a Drupal core bug. Only not installed/uninstalled modules should be left out in the permissions form. Disabled modules can be re-enabled at any time.

So we have 4 options to fix this:

1) Output a message on top of the form to allow the user to re-enable the disabled developer modules, so they do not lose any data.

2) Use hook_init() to re-enable any disabled developer modules on that page, and hook_form_alter() to add a submit handler to the form to disable them again. (Will fail when user only visits the page, but does not submit the form.)

3) Use hook_form_alter() to add all disabled developer modules to the form.

4) Move this issue to Drupal core and fix the underlying bug there.

Comments

sun’s picture

Project: Administration menu » Drupal core
Version: 6.x-3.x-dev » 7.x-dev
Component: Code » user system
Category: task » bug

After discussion with dww, let's move this to Drupal core.

dww’s picture

Component: user system » base system
Priority: Critical » Normal

IMHO, this is a core bug, not something admin menu should be hacking around. I don't think I'd call this "critical", but it's close. Someone's probably going to call this "by design", since it's a "feature" that when you save the permissions page, everything gets "cleaned up". But, it sure makes for hellish UX for admins if they disable a module with a lot of permissions, save the permissions page, and then re-enable things...

sun’s picture

Component: base system » user system
Assigned: Unassigned » sun
Priority: Normal » Critical

For now, assigning to myself to keep track of this issue. Waiting for the revert of the registry to come up with an initial attempt.

sun’s picture

Issue tags: +API clean-up

Introducing a new tag for feature freeze: API clean-up.

sun’s picture

#300993: User roles and permissions API seems like it could vastly help to fix this issue.

sun’s picture

Status: Active » Fixed

Based on manual testing, #300993: User roles and permissions API fixed this issue.

Marking as fixed. We could re-open this issue though to add some tests ;)

Status: Fixed » Closed (fixed)
Issue tags: -API clean-up

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