Permissions are not allowed to have special chars like single quotes and other non english characters. In my installation update of link checker module failed because of single quotes in the permission names of Module Grants. Please check #532178: Database update #6209 failed and #539666: Permission names (for homebox names containing special chars)

Comments

RdeBoer’s picture

Category: bug » task
Status: Active » Closed (won't fix)
hass’s picture

Category: task » bug
Status: Closed (won't fix) » Active

Incorrect. Please read the linked articles. CORE does not support permission names with single quotes / special chars. Module Grants MUST filter all other chars out. See http://drupal.org/node/539666#comment-1933412 for an example or better read the full conversation in this case.

hass’s picture

This is the buggy line!

function module_grants_perm() {
  return array("access 'I created' tab", "access 'I last modified' tab", "access 'I can edit' tab", "access 'I can view' tab",
    "access 'Published' tab", "access 'Unpublished' tab", "access 'All' tab");
}
hass’s picture

Also see Gabors comment on this in http://drupal.org/node/540016#comment-1927142

rhouse’s picture

Hi Rik,

You are probably right that there is no law against single quotes, but defensive programming is the best way to go. The last thing we want is something like a core version upgrade to fail because of this. How about double quotes? Or no punctuation, but spelling the quoted text in capitals to set it off?

Ron.

RdeBoer’s picture

I think you're write Ron,
But I can already see the complaints coming of users who
1) have to redo their permissions (everyone)
2) upgrade Revisioning but not Module Grants and complain about errors (only the forgetful ones)
Rik

hass’s picture

Everything not in [a-zA-Z0-9] is not expected. In D7 we now have an additional title and description where all is allowed, but internal permission names have the same rules as before.

hass’s picture

Redo the permissions by hand is not required. See the linked cases. There is an updrade hook for the permission name changes. You can also find an example in core, linkchecker, gotwo, homesite and others. No problem to change.

RdeBoer’s picture

Assigned: Unassigned » RdeBoer
Status: Active » Fixed

Committed to repository. New development snapshot available later today.
Please make sure when prompted that you run the update script (update #6207) to remove any quotes from existing permissions on the db.
If you use Revisioning you will also need to upgrade to the latest dev version.

Status: Fixed » Closed (fixed)

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