Related to the work done in #1840236: hook_feature_revert() incorrect?.

I have created a features module drupal7_metatag with some metatag configs

When I revert the feature with metatag configs with drush fr --force drupal7_metatag I am getting the following error

PHP Fatal error:  Call to undefined function drupal7_metatag_metatag_export_default() in /private/var/www/drupal7/docroot/sites/all/modules/metatag/metatag.features.inc on line 55

The issue is drupal7_metatag.features.metatag.inc is not being loaded before the function drupal7_metatag_metatag_export_default() is called in metatag_feature_revert(). I have confirmed that by adding a include_once 'drupal7_metatag.features.metatag.inc'; in the drupal7_metatag.module solves the problem. With a lot of help from q0rban and juampy, we noticed that features_include_defaults() is not getting loaded to include all the necessary inc files. Looking through the implementation of features.taxonomy, features.user, etc, it seems like the standard way to implement a hook_features_revert() is to call features_get_default('{module}', $module). Patch to follow.

CommentFileSizeAuthor
#1 metatag-features-revert-1866980.patch1.72 KBmakangus
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

makangus’s picture

Status: Active » Needs review
FileSize
1.72 KB
DamienMcKenna’s picture

Status: Needs review » Fixed

@makangus: Good catch, thanks! Committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.