Skip to content

Commit

Permalink
field-create: Fix default value if show-machine-names option is off
Browse files Browse the repository at this point in the history
  • Loading branch information
DieterHolvoet committed Apr 2, 2022
1 parent 323aa99 commit 78318d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Drupal/Commands/field/FieldCreateCommands.php
Expand Up @@ -315,7 +315,9 @@ protected function askFieldWidget(): string
$choices[$name] = $label;
}

return $this->io()->choice('Field widget', $choices, key($choices));
$default = $this->input->getOption('show-machine-names') ? key($choices) : current($choices);

return $this->io()->choice('Field widget', $choices, $default);
}

protected function askRequired(): bool
Expand Down

0 comments on commit 78318d1

Please sign in to comment.