Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve ability to not pass a role label (for now). #5118

Merged
merged 1 commit into from Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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