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.
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
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
#1
Please add some hints how to solve this :)
#2
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.
#3
Perhaps a elegant and short solution with the help of dereine.
#4
Another solution, independant from adminrole, not as short and elegant as the solution above.
#5
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
#6
#7
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
#8
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
#9
#7 I'm not sure why I missed that nice #4 ... sorry for the long delay.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.