A few days ago, I posted this issue as a comment to issue #1028112 http://drupal.org/node/1028112#comment-5065774 and was recommended by @david_rothstein to create a new issue.

David verified the issue using my sample code below - refer to the noted issue above to see David's suggestion as the source.

Issue Description:
I've run into a very odd issue with the hook_install_tasks function where adding a simple watchdog statement causes the form submit handler to not fire. I could not figure out why the custom profile task was not executing and it was not until I removed the watchdog statement (that was added earlier while I was testing the new code), did the code start to work.

Very odd indeed but I've duplicated it using the standard install profile as well. When the watchdog statement in the hook_install_tasks() is enabled, the submit handler does not fire.

<?php

/**
* Implements hook_form_FORM_ID_alter().
*
* Allows the profile to alter the site configuration form.
*/
function standard_form_install_configure_form_alter(&$form, $form_state) {
  // Pre-populate the site name with the server name.
  $form['site_information']['site_name']['#default_value'] = $_SERVER['SERVER_NAME'];
}

/**
* Implements hook_install_tasks().
*/
function standard_install_tasks() {
  watchdog('test','define custom install profile task');
  $tasks = array(); 
  $tasks['standard_custom_form'] = array(
    'display_name' => st('Install Custom Task'),
    'type' => 'form',
  );
  return $tasks;
}


/**
* Task callback:
*/
function standard_custom_form() {
  drupal_set_title(st('Custom Install Profile Task'));

  $form['custom_task'] = array(
    '#type' => 'radios',
    '#title' => st('Run custom install task?'),
    '#options' => array('yes' => st('Yes'), 'no' => st('No')),
    '#default_value' => 'yes',
    '#description' => st('Test of adding a custom install profile task'),
  );
 
  $form['actions'] = array('#type' => 'actions');
  $form['submit'] = array('#type' => 'submit', '#value' => st('Run Test'));

  return $form;
}



/**
* Submit callback:
*/
function standard_custom_form_submit(&$form, &$form_state) {
  if ($form_state['values']['custom_task'] == 'yes') {
     watchdog('install','standard_custom_form submit handler executed');
  }
 
 
}

Comments

Dave Cohen’s picture

subscribing

David_Rothstein’s picture

dagmar’s picture

Component: watchdog.module » dblog.module

Moved to dblog.module for future triage.