1

This is my hook_install:

function moocollar_web_install() {

  // enable features
  $global_features = array ('display_modes_feature' , 'field_bases_feature' , 'image_styles_feature' , 'roles_permissions_feature' , 'sitewide_feature'  , 'wysiwyg_feature' , 'menus_feature');
  $functionality_features = array ('blog_feature');

  $enable_dependencies = TRUE;
  module_enable($global_features, $enable_dependencies);
  module_enable($functionality_features, $enable_dependencies);

  // create editor user
  $role = user_role_load_by_name ('editor');
  $new_user = new stdClass();
  $new_user->name = 'editor';
  $new_user->pass = user_password(8); // random password.
  $new_user->mail = 'editor@example.com';
  if ($role) {
    $new_user->roles = array ($role->rid => $role->name);
  } 
  $new_user->status = 1;
  $new_user->is_new = TRUE;
  user_save($new_user);

  variable_set('features_default_export_path', 'profiles/moocollar_web/modules/features');
}

After install the blog_feature is overriden:

drush features-diff blog_feature
Legend: 
Code:       drush features-revert will remove the overrides.
Overrides:  drush features-update will update the exported feature with the displayed overrides


Component type: info
  features[field_instance][] = node-blog_post-body
  features[field_instance][] = node-blog_post-field_image
< features[menu_links][] = menu-editor-menu_aadir-post:node/add/blog-post
  features[node][] = blog_post
  features[user_permission][] = create blog_post content


Component type: menu_links
< array(
<   'menu-editor-menu_aadir-post:node/add/blog-post' => array(
<     'customized' => 1,
<     'link_path' => 'node/add/blog-post',
<     'link_title' => 'Añadir post',
<     'menu_name' => 'menu-editor-menu',
<     'module' => 'menu',
<     'options' => array(
<       'identifier' => 'menu-editor-menu_aadir-post:node/add/blog-post',
<     ),
<     'router_path' => 'node/add/blog-post',
<   ),
< )
---
> array()

But if I execute revert features via drush, the features is on default state:

drush features-revert blog_feature
Do you really want to revert blog_feature.menu_links? (y/n): y
Reverted blog_feature.menu_links.                                                                       [ok]
vagrant@precise32 (linkinicio *) httpdocs$ drush fd blog_feature
Feature is in its default state. No diff needed. 

On the blog_feature.info I've the dependency and the item:

...
dependencies[] = menu
dependencies[] = menus_feature
....
features[menu_links][] = menu-editor-menu_aadir-post:node/add/blog-post
....

Thanks you all for your time.

1

Normally Features automatically detects ctools exportables and add the modules containing those exportables to the dependency list, unless a module requirement for an exportable was not detected, or dependent modules were installed since feature was enabled.

Based on your menu link machine name (menu-editor-...), it seems it relies on Menu Editor module and you've missing dependency to that module, therefore Features module didn't detect that component as a requirement, so it become overridden and unrevertable.

The solution is to add the missing module into dependencies list. Then either disable the feature module and reenable it, or manually enable any dependencies not enabled (see Feature Diff to expose them).

See: Troubleshooting: Reasons Features may be stuck as Overridden at Drupal.org

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.