Skip to content

Commit

Permalink
Fixed boolean properties always being treated as yes in interactive m…
Browse files Browse the repository at this point in the history
…ode.
  • Loading branch information
joachim-n committed May 14, 2017
1 parent 58900d1 commit d4d58d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions commands/module_builder/module_builder.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,13 @@ function module_builder_drush_interactive_prompt($property_name, $property_info,
}
}

// Convert boolean property input to an actual boolean.
if ($property_info['format'] == 'boolean') {
if (in_array(strtolower($value), ['no', 'n'])) {
$value = FALSE;
}
}

// Callback to convert a value given as an index in a list of options into
// the actual option value.
$convert_index_to_value_callback = function($item) use ($option_by_index) {
Expand Down

0 comments on commit d4d58d9

Please sign in to comment.