4

I cannot find any documentation on the variables[] array in an installation profile info file. I can set some variables successfully in that file and others give me an invalid format error when I visit the settings page to check them after the install. The ones that I would like to set are:

variables[site_403] = <front>
variables[user_cancel_method] = user_cancel_block
variables[update_check_frequency] = 7
variables[update_notification_threshold] = security
variables[update_notify_emails] = myemail@example.com

In Drupal the source it looks like update_notify_emails is probably an array. Is there a way to make this setting an array via this .info file? I am trying to set these using the info file or the install hook rather than exporting the variables as features using a strongarm.inc due to these best practice recommendations linked on this distribution developers guide page.

1 Answer 1

5

You should be able to set these in the .install file in your profile. I've struggled with this well, and the .install seems to be the best way to do it.

<?php 
/**
 * Implements hook_install().
 *
 * Performs actions to set up the site for this profile.
 *
 * @see system_install()
 */
function customProfile_install() {
  /*
    Other cool functions... 
   */

  variable_set('site_403','<front>');
  // etc....
}
1
  • Agreed. Since I posted this I have written 2 or 3 .install files and at least the php code is well documented while the .info file is not.
    – lolcode
    Mar 28, 2013 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.