diff options
-rw-r--r-- | modules/user/user.module | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 8bd18d43d..3f9c7652b 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -2118,16 +2118,18 @@ function user_user_operations() { $remove_roles['remove_role-'. $key] = $value; } - $role_operations = array( - t('Add a role to the selected users') => array( - 'label' => $add_roles, - ), - t('Remove a role from the selected users') => array( - 'label' => $remove_roles, - ), - ); + if (count($roles)) { + $role_operations = array( + t('Add a role to the selected users') => array( + 'label' => $add_roles, + ), + t('Remove a role from the selected users') => array( + 'label' => $remove_roles, + ), + ); - $operations += $role_operations; + $operations += $role_operations; + } } // If the form has been posted, we need to insert the proper data for role editing if necessary. |