When using devel to generate authenticated users, the saved roles are incorrect. See attached image. The generated user has two roles: authenticated (which is correct) and Authenticated (which is incorrect).
This produces notices when displaying roles in a View: Notice: Undefined index: Authenticated in views_handler_field_user_roles->pre_render()
I believe the issue is that devel_generate_users_form_submit() is passing an unfiltered roles array keyed by the machine names editor and administrator with 0 values (since the goal was to create authenticated users with no other role). This confuses the user save functions.
Proposed solution: do an array_filter and pass the resulting array_keys to devel_create_users().
When using devel to generate authenticated users, the saved roles are incorrect. See attached image. The generated user has two roles:
authenticated
(which is correct) andAuthenticated
(which is incorrect).This produces notices when displaying roles in a View:
Notice: Undefined index: Authenticated in views_handler_field_user_roles->pre_render()
I believe the issue is that
devel_generate_users_form_submit()
is passing an unfiltered roles array keyed by the machine nameseditor
andadministrator
with0
values (since the goal was to create authenticated users with no other role). This confuses the user save functions.Proposed solution: do an array_filter and pass the resulting array_keys to
devel_create_users()
.