With more complex installation profiles coming up, it would be really useful to have a consistent way of passing parameters to installation profiles forms.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Status: Active » Needs review
FileSize
2.16 KB

Here is probably one of the simplest way to do that:

drush site-install standard install_configure_form.site_default_country=FR my_profile_form.my_settings.key=value
moshe weitzman’s picture

Looks pretty clean to me. Can anyone suggest a profile to use for testing this? Do we need to change anything to support D6 also?

Damien Tournoud’s picture

Drupal 6 support would be hairy, because there is not consistent form support during installation in there. I suggest supporting this only for Drupal 7 onwards.

The Git version of Commerce Kickstart (git clone --branch 7.x-1.x damz@git.drupal.org:project/commerce_kickstart.git) has a very simple configuration form that let you select if you want some demo content to be created or not (currently, the dummy content is exactly one product):

; Create the demo content (it is the default).
$ drush -y site-install commerce_kickstart commerce_kickstart_demo_form.demo_content=1
$ drush -y site-install commerce_kickstart
; Don't create the demo content.
$ drush -y site-install commerce_kickstart commerce_kickstart_demo_form.demo_content=0

Also, the standard core configuration form has some parameters that have no explicit options in drush site-install:

; Set the default country.
drush site-install standard install_configure_form.site_default_country=FR
; Set the default timezone.
drush site-install standard install_configure_form.date_default_timezone="Europe/Paris"

I updated the site-install --help documentation in this new version of the same patch.

moshe weitzman’s picture

Status: Needs review » Fixed

Committed to master and 4.x. Thanks.

msonnabaum’s picture

This was causing an error when drush_core_site_install() would get called without any addition args, which left $form_options as NULL instead of an array. THis was causing tests to fail.

I committed 2fcba50c1324413ef844922eee2d673838980736 which fixes it for me.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

girishmuraly’s picture

Unchecking checkbox form elements through the above solution does not work properly. See #1247338: Site Install extra options checkboxes are difficult