When modules were installed via drush_mm the permission-sets for adminrole were not updated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

clemens.tolboom’s picture

Status: Active » Postponed (maintainer needs more info)

Please add some hints how to solve this :)

fl3a’s picture

When i enable a module via admin/build/modules, the message "Admin Permissions Set" appears and all permission were set for adminrole for the anable module.
When i enable the module via drush mm enable module, the permission are not activated.

I exspect function adminrole_update_perms() in adminrole.module to be not not called.
When i call drush6_ -l http://example.com eval "adminrole_update_perms();" (alias drush6_='/home/florian/bin/drush6 -r /home/florian/drupal/6.x ' and bin/drush6: symbolic link to `/home/florian/drupal/6.x/sites/all/modules/drush/drush.php') - tada, it works - workaround :D

A solution could be something like looking in the system-table for %adminrole.module or sites/all/modules/adminrole/adminrole.module && status == 1, eval statement, message.

fl3a’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
676 bytes
676 bytes

Perhaps a elegant and short solution with the help of dereine.

fl3a’s picture

FileSize
573 bytes

Another solution, independant from adminrole, not as short and elegant as the solution above.

clemens.tolboom’s picture

I'm not sure about module_invoke_all is best. Guess there is a broken thingy between enabling through drush_mm and submitting the modules page.

My guess is adminrole uses a hook_form_alter to get notified about form submission.

We need to check this.

Checking for the existence of the adminrole module is way out of line :p

clemens.tolboom’s picture

Status: Needs review » Needs work
fl3a’s picture

Hi,
you are right with your guess, the last function in adminrole.module is the implementation of hook_form_alter, from where adminrole gets notified about form-submissions and adminrole_update_perms is called.

With module_invoke_all we got imho the same effect.

#4 is perhaps way out of line, it was a workaround...
But as i mentioned above, not as elegant as #3 and no need to patch adminrole also
and btw #3 was the result of testing and reviewing #4 with dereine :D

rsvelko’s picture

just a notice: drush now has a command "enable" which when used sets the permission for the administrator role automatically - tested with two sites and 2 modules.... looked into the code - they use the form and the modules/system/system.admin.inc file for module_enable function ...

this is in commands/pm/pm.drush.inc -> function pm_module_manage - line 204

clemens.tolboom’s picture

Version: 6.x-1.1 » 6.x-2.x-dev
Assigned: Unassigned » clemens.tolboom
Status: Needs work » Fixed

#7 I'm not sure why I missed that nice #4 ... sorry for the long delay.

Status: Fixed » Closed (fixed)

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