In wanting to uncheck the 'Receive e-mail notifications' checkbox under installation with drush site-install
, I discovered that unchecking a checkbox with the key=value
feature is not possible.
install_configure_form
sets update_status_module[2]
to the value 2 if it is checked. If the checkbox is not checked, the variable will not be set.
In install_configure_form_submit
Drupal adds the admin e-mail to the update_notify_emails
variable if $form_state['values']['update_status_module'][2]
is set.
// Add the site maintenance account's email address to the list of
// addresses to be notified when updates are available, if selected.
if ($form_state['values']['update_status_module'][2]) {
variable_set('update_notify_emails', array($form_state['values']['account']['mail']));
}
I tried drush si install_configure_form.update_status_module[2]=0
(and also tried to set it to NULL, FALSE, "" and adding nothing after the = with the same results). The admin e-mail always gets added to the update_notify_emails
variable.
My motivation for unchecking this checkbox is to avoid errors when using drush site-install
and not having sendmail configured on the development server.
sh: /usr/sbin/sendmail: not found
WD mail: Error sending e-mail (from admin@example.com to admin@example.com).
WD cron: Cron run completed.
Installation complete. User name: admin User password: xUPTCibcmA
Unable to send e-mail. Contact the site administrator if the problem persists.
Comments
Comment #1
regilero CreditAttribution: regilero commentedhave you tried the workaround descrivbe here http://drupal.org/node/1247338 ?
Which would be :
drush site-install install_configure_form.update_status_module[2]
Comment #2
andyg5000This appears to have worked for me:
drush site-install install_configure_form.update_status_module='array(FALSE,FALSE)'
setting both of the following to false
'#options' => array(
1 => st('Check for updates automatically'),
2 => st('Receive e-mail notifications'),
),
Comment #3
shirley.chan CreditAttribution: shirley.chan commentedThank you, andyg5000! Your solution works for my build script! Since my system is not setup with a mail server, drush site-install kept returning the error,
causing my script to fail even though the install was succssful. With the e-mail notifications turned off, my script can now execute pass drush site-install.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedAdded to docs for site-install
Comment #6
pfrenssenFor reference here is a link to Moshe's commit from #4: 2ccfe92.