If using a language settig not equal to 'en' this notice will occur in line 155 and further.
The grouping keys 'Add a role to the selected users' and 'Remove a role from the selected users' should be translated e.g like this:
/**
* Alters user_admin_account
*/
function user_permissions_form_user_admin_account_alter(&$form, &$form_state, $form_id) {
$groupadd = t('Add a role to the selected users');
$groupremove = t('Remove a role from the selected users');
if (is_array($form['options']['operation']['#options'][$groupadd]) &&
is_array($form['options']['operation']['#options'][$groupremove])) {
// Removes _user_role_N roles from the 'Add a role to the selected users' Update Option on the /admin/people page
foreach ($form['options']['operation']['#options'][$groupadd] as $key => $value) {
if (preg_match('/^_user_role_\d+$/', $value)) {
unset($form['options']['operation']['#options'][$groupadd][$key]);
}
}
// Removes _user_role_N roles from the 'Remove a role from the selected users' Update Option on the /admin/people page
foreach ($form['options']['operation']['#options'][$groupremove] as $key => $value) {
if (preg_match('/^_user_role_\d+$/', $value)) {
unset($form['options']['operation']['#options'][$groupremove][$key]);
}
}
}
}
may be a better solution is to use count($roles) instead of is_array(), see users.module line 3099
Comments
Comment #1
Effixe commentedHello!
Just in case I've made a .patch to add the function t() (like it is in the post of dreizwo).
Is the evolution of the module dead?
Comment #2
pimok3000 commentedThanks for that patch. Seems to work great!
Comment #3
b-prod commentedThanks for the report! Fixed by commit 6b2881f19b03a1df384fb870937d7aac1002cabf.