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

Effixe’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new2.09 KB

Hello!

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?

pimok3000’s picture

Thanks for that patch. Seems to work great!

b-prod’s picture

Issue summary: View changes
Status: Patch (to be ported) » Fixed

Thanks for the report! Fixed by commit 6b2881f19b03a1df384fb870937d7aac1002cabf.

Status: Fixed » Closed (fixed)

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