Spin-off from #935062: Change role id to machine name

No code in Drupal should use those magic numbers.

This should be backported.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. In a cursory grep for 'roles\[' I didn't catch any others.

Dries’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 8.x. Moving to 7.x.

tim.plunkett’s picture

Status: Patch (to be ported) » Needs review
FileSize
8.23 KB

Rerolled.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/bbe4b34

-   * @param integer $rid Role id.
...
+   * @param string $rid
+   *   The role ID to search for.

A little odd we're saying that the role ID is supposed to be a string, although in practice I suppose the calling code does tend to pass (numeric) strings to it rather than integers.

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