Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When modules were installed via drush_mm the permission-sets for adminrole were not updated.
Comment | File | Size | Author |
---|---|---|---|
#4 | drush_mm_adminrole.patch | 573 bytes | fl3a |
#3 | drush_mm_enable_hook.patch | 676 bytes | fl3a |
Comments
Comment #1
clemens.tolboomPlease add some hints how to solve this :)
Comment #2
fl3a CreditAttribution: fl3a commentedWhen 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.
Comment #3
fl3a CreditAttribution: fl3a commentedPerhaps a elegant and short solution with the help of dereine.
Comment #4
fl3a CreditAttribution: fl3a commentedAnother solution, independant from adminrole, not as short and elegant as the solution above.
Comment #5
clemens.tolboomI'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
Comment #6
clemens.tolboomComment #7
fl3a CreditAttribution: fl3a commentedHi,
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
Comment #8
rsvelko CreditAttribution: rsvelko commentedjust 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
Comment #9
clemens.tolboom#7 I'm not sure why I missed that nice #4 ... sorry for the long delay.