drush_mm and adminrole

fl3a - February 19, 2009 - 12:29
Project:Drush Module Manager
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:clemens.tolboom
Status:closed
Description

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

#1

clemens.tolboom - February 20, 2009 - 15:46
Status:active» postponed (maintainer needs more info)

Please add some hints how to solve this :)

#2

fl3a - February 20, 2009 - 17:55

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

fl3a - February 22, 2009 - 00:05
Status:postponed (maintainer needs more info)» needs review

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

AttachmentSize
drush_mm_enable_hook.patch 676 bytes

#4

fl3a - February 22, 2009 - 01:49

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

AttachmentSize
drush_mm_adminrole.patch 573 bytes

#5

clemens.tolboom - February 23, 2009 - 09:25

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

clemens.tolboom - February 26, 2009 - 09:50
Status:needs review» needs work

#7

fl3a - February 28, 2009 - 10:33

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

rsvelko - April 16, 2009 - 18:22

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

clemens.tolboom - May 9, 2009 - 15:33
Version:6.x-1.1» 6.x-2.x-dev
Assigned to:Anonymous» clemens.tolboom
Status:needs work» fixed

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

#10

System Message - May 23, 2009 - 15:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.