Closed (duplicate)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2011 at 12:40 UTC
Updated:
6 May 2012 at 20:34 UTC
The module comes with some useful defaults, however it's not possible to change and export them via features as features just adds the dependency on the module.
Maybe better, defaults are not provided as defaults in code but just added during installation. Also, best those defaults are only added when not installed via an installation profile, so installing a distribution having such feature exports works. E.g. for profile2 I do it that way:
function profile2_install() {
// Add an initial profile type, but only if installed manually. In case the
// module is installed via an installation profile, skip that.
if (!drupal_installation_attempted()) {
$type = entity_create('profile2_type', array(
'type' => 'main',
'label' => t('Main profile'),
'weight' => 0,
'data' => array('registration' => TRUE, 'use_page' => TRUE),
));
$type->save();
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('edit own main profile', 'view own main profile'));
drupal_set_message(t('A main profile type has been created and assigned to all users. Go to the <a href="!url">Profile types</a> page to add some fields or to configure further profile types.', array('!url' => url('admin/structure/profiles'))));
}
}
Comments
Comment #1
ivan zugec commentedA ticket has already been raised about this issue. http://drupal.org/node/1305200