I've setup a custom installation profile, and of my installation steps is setting up Google Analytics. I've downloaded the Google Analytics module and enabled it in my site profile.
What I'm doing in my install step is as follows:
hook_install_tasks()
$tasks['site_google_analytics_form'] = array(
'display' => TRUE,
'type' => 'form',
'display_name' => st('Google Analytics Configuration'),
);
site_google_analytics_form()
/**
* Configure google analytics. The only required field is the tracking code.
*/
function site_google_analytics_form() {
module_load_include('inc', 'googleanalytics', 'googleanalytics.admin');
return drupal_get_form('googleanalytics_admin_settings_form');
}
The probelm I'm having is that, even if I enter a valid web property ID, the form always comes back saying that an invalid ID was entered. I checked to make sure the validation function is firing (which also is in googleanalytics.admin.inc), and it is, but the $form_state
variable doesn't have any of the form values preserved.
So, I guess my question is this - why is the $form_state
variable being passed into the validation function not storing the values I specified in the form during the install step?