You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Distinguish between an empty db prefix and no db prefix
[site:install] Atm you have to use --no-interaction if you want to pass an empty db prefix. If you type --db-prefix="" the result is the same as if you had just simply omitted this option.
Problem/Motivation
If the value of an option is explicitly set it should not be asked for later. You can suppress this inconsistent behaviour with --no-interaction but one should not need
I am running into this issue whenever I'm trying to set up a "throw away" installation.
How to reproduce
Last checked on Drupal 8.6.1 with drupal/console 1.8.0
composer create-project drupal-composer/drupal-project:8.x-dev somedirectory --stability dev --no-interaction
cd somedirectory
vendor/bin/drupal si standard \
--langcode="en" \
--db-type="sqlite" \
--db-file="sites/default/files/drupaldb.sqlite " \
--db-prefix="" \
--account-name=admin \
--account-pass=admin \
[email protected] \
--site-name="This is just a test" \
--site-mail="[email protected]"
Even though the --db-prefix is set, the command will ask for the prefix (the default value is an empty string).
Solution
If no --db-prefix is given, the option's default value is null. So in Site\InstallCommand::interact() we can easily distinguish between "no --db-prefix given" (ask) and "empty --db-prefix given" (no action).
The text was updated successfully, but these errors were encountered:
Distinguish between an empty db prefix and no db prefix
[site:install] Atm you have to use
--no-interaction
if you want to pass an empty db prefix. If you type--db-prefix=""
the result is the same as if you had just simply omitted this option.Problem/Motivation
If the value of an option is explicitly set it should not be asked for later. You can suppress this inconsistent behaviour with
--no-interaction
but one should not needI am running into this issue whenever I'm trying to set up a "throw away" installation.
How to reproduce
Last checked on Drupal 8.6.1 with drupal/console 1.8.0
Even though the
--db-prefix
is set, the command will ask for the prefix (the default value is an empty string).Solution
If no
--db-prefix
is given, the option's default value is null. So in Site\InstallCommand::interact() we can easily distinguish between "no--db-prefix
given" (ask) and "empty--db-prefix
given" (no action).The text was updated successfully, but these errors were encountered: