Skip to content

Commit

Permalink
Preserve ability to not pass a role label (for now). (#5118)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Apr 7, 2022
1 parent d1fbeee commit 668fdb9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Drupal/Commands/core/RoleCommands.php
Expand Up @@ -21,8 +21,6 @@ class RoleCommands extends DrushCommands implements SiteAliasManagerAwareInterfa
* @command role:create
* @param $machine_name The symbolic machine name for the role.
* @param $human_readable_name A descriptive name for the role.
* @usage drush role:create 'test role'
* Create a new role 'test role'. On D8, the human-readable name will be 'Test role'.
* @usage drush role:create 'test role' 'Test role'
* Create a new role with a machine name of 'test role', and a human-readable name of 'Test role'.
* @aliases rcrt,role-create
Expand All @@ -31,7 +29,7 @@ public function create($machine_name, $human_readable_name = null)
{
$role = Role::create([
'id' => $machine_name,
'label' => $human_readable_name,
'label' => $human_readable_name ?: ucfirst($machine_name),
], 'user_role');
$role->save();
$this->logger()->success(dt('Created "!role"', ['!role' => $machine_name]));
Expand Down

0 comments on commit 668fdb9

Please sign in to comment.