Hello,

I've noticed that user selectable roles are broken again. The reason for that is because array_unshift doens't work like expected with numerical keys. See

array_unshift() prepends passed elements to the front of the array. Note that the list of elements is prepended as a whole, so that the prepended elements stay in the same order. All numerical array keys will be modified to start counting from zero while literal keys won't be touched.

from here: http://php.net/manual/en/function.array-unshift.php

So for the case when "none" is added to the array, the rids are lost. The fix would be to replace array_unshift with something like this:

$roles = array(0 => t('None')) + $roles;

Comments

mike.davis’s picture

Hi Stefan,

Thanks for the patch. I'll have a look at this issue and your patch and see if we can get this resolved ready for another release.

Thanks
Mike

mike.davis’s picture

Thanks Stefan, this has been fixed now and a new beta release.

mike.davis’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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