I am looking for the way to set some settings at the install step.
function genius_profile_final() {
// Enable default permissions for system roles.
$filtered_html_permission = filter_permission_name($filtered_html_format);
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', 'access comments', $filtered_html_permission));
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', 'access comments', 'post comments', 'skip comment approval', $filtered_html_permission));
// Create a default role for site administrators, with all available permissions assigned.
$admin_role = new stdClass();
$admin_role->name = 'administrator';
$admin_role->weight = 2;
user_role_save($admin_role);
user_role_grant_permissions($admin_role->rid, array_keys(module_invoke_all('permission')));
// Set this as the administrator role.
variable_set('user_admin_role', $admin_role->rid);
// Assign user 1 the "administrator" role.
db_insert('users_roles')
->fields(array('uid' => 1, 'rid' => $admin_role->rid))
->execute();
// Create a role for webmaster
$webmaster_role = new stdClass();
$webmaster_role->name = 'webmaster';
$webmaster_role->weight = 3;
user_role_save($webmaster_role);
user_role_grant_permissions($webmaster_role->rid, array_keys(module_invoke_all('permission')));
variable_set('taxonomy_menu_vocab_menu_rubric', 'menu-genius-navigation-menu');
variable_set('taxonomy_menu_vocab_parent_rubric', 0);
menu_rebuild();
// Set the regional settings First day to Monday
variable_set('date_first_day', 1);
// The return message is optional, if you omit it the default will be used.
return '<p>'. (drupal_set_message() ? t('Please review the messages above before continuing on to <a href="@url">your new Profile Name site</a>.', array('@url' => url(''))) : t('You may now visit <a href="@url">your new Profile Name site</a>.', array('@url' => url('')))) .'</p>';
}
In genius_profile_final()
, where as I understood Drupal is fully bootstrapped, I have variable_set('date_first_day', 1)
, but the first day of the week still is set to Sunday, after the installation. So it is not working as I expected.
I am using the taxonomy_menu module, and I would like to set at the installation step the menu to be linked with the taxonomy. Because I am installing something known, I know the variable names that might be set are:
variable_set('taxonomy_menu_vocab_menu_rubric', 'menu-genius-navigation-menu');
variable_set('taxonomy_menu_vocab_parent_rubric', 0);
This is not working neither.
I have been following https://www.drupal.org/node/1022020 and looking at other examples but I have had no luck to find how to do this.
Is it possible to change settings in an install profile or are there any restriction? In that case, what restrictions are?
What am I doing wrong?