That happens, when you had deleted a role and later added another.
The culprit definitvely is the array_merge function used on line 75 - it happens to renumber the keys of the array!
It's not a matter of using ksort or asort though, that is just a matter of taste - and I would prefer to stick with ksort, because it reflects the ordering of Drupal in its role screens.

CommentFileSizeAuthor
#2 adminrole.module.360091.patch980 bytesjaydub
#1 adminrole_5.x-1.5.patch884 bytesa8w4

Comments

a8w4’s picture

Status: Active » Needs review
StatusFileSize
new884 bytes

so this is my corresponding patch...

jaydub’s picture

StatusFileSize
new980 bytes

Attached patch includes changes in the patch added to #360091: Use DRUPAL_AUTHENTICATED_RID instead of hard-coded '2'. This patch more or less brings the D5 admin setting form to the D6 level.

jaydub’s picture

For what it's worth, the development snapshot D5 version of Admin Role already has removed the array_merge and so is the same as the D6 module. The patch here and in #360091: Use DRUPAL_AUTHENTICATED_RID instead of hard-coded '2' just improves things a bit more.

dave reid’s picture

Status: Needs review » Closed (duplicate)

This is just a duplicate of #360091: Use DRUPAL_AUTHENTICATED_RID instead of hard-coded '2' then which has a D5 patch included.