Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
During the update on the latest 6.x-1.x, I lost all my permissions for the comment_notify module. There's something a little odd in comment_notify_update_6001:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/comment_not...
/**
* Permissions got renamed, update them.
*/
function comment_notify_update_6001() {
$ret = array();
$result = db_query("SELECT pid, perm FROM {permission}");
while ($row = db_fetch_object($result)) {
$permissions = explode(', ', $row->perm);
if (in_array('Subscribe to comments', $permissions) && !in_array('subscribe to comments', $permissions)) {
$permissions[] = 'create gmap macro';
}
if (in_array('Administer comment notify', $permissions) && !in_array('administer comment notify', $permissions)) {
$permissions[] = 'create gmap macro';
}
$permissions = implode(', ', $permissions);
db_query("UPDATE {permission} SET perm = '%s' WHERE pid = %d", $permissions, $row->pid);
}
return $ret;
}
Not sure what the 'create gmap macro' permission has to do with this module, but I'm guessing that's why my permissions disappeared. :)
Comment | File | Size | Author |
---|---|---|---|
#1 | 353727_permissions_fix_for_real.patch | 1.02 KB | greggles |
Comments
Comment #1
gregglesThanks for the close eye, Dave Reid.
This was introduced in #322089: Small UI inconsistencies where I copied some code from gmap to update the permissions but didn't fix everything quite right....
The attached patch is applied to the 6.x-1.x version (it wasn't change for 5.x) http://drupal.org/cvs?commit=162348
Thanks again!