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. :)

CommentFileSizeAuthor
#1 353727_permissions_fix_for_real.patch1.02 KBgreggles
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Assigned: Unassigned » greggles
Status: Active » Fixed
FileSize
1.02 KB

Thanks 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!

Status: Fixed » Closed (fixed)

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