I use module metatag, and I have problem with revert "features" containing contexts.

Step by step instruction for reproduce problem:

1. You should have last version of module metatag;
2. First, create custom metatag setting for special url on this page "admin/config/search/metatags/context";
3. Add your new context into "feature";
4. Copy your "feature" with new context to separate server (or remove this context via interface for quickly testing on your local server);
5. You will see that "feature" with your context have status overriden;
6. When you will revert feature, your new context not will be created (and not will be reverted, but will be removed from database, in case if it was created earlier);
7. "Feature" with your context always will be overriden.

I have investigated the file features.context.inc. The function context_features_revert is only remove contexts, but not create new contexts that are contained in the my "feature".

This small patch solves the problem.

I will be very grateful if you add me as author of commit.

fix-revert-feature-contexts.patch585 byteseugene.ilyin


eugene.ilyin’s picture

Status:Active» Needs review
eugene.ilyin’s picture

Any news? Review my patch please.

eugene.ilyin’s picture

Who can see my patch please?

mpotter’s picture

Status:Needs review» Closed (works as designed)

Contexts are ctools exportables that only live in code and not in the database. Something else must be happening on your site as I cannot reproduce this. My context's are exported fine.

When you export a context to a feature, you should get a myfeature.context.inc file that contains your hook function: myfeature_context_default_contexts(). The Context module calls this hook to allow new contexts to be added via code. No database entires are made for this. This is how all "true" features work (ctools, views, etc).

So reverting should not perform any sort of "save".

The fact that your feature was marked as overridden in #5 sounds like your problem. Did you be sure to clear the drupal cache on the new site after installing the feature. You must always clear Drupal cache "drush cc all" after enabling new features for them to show up properly.

caschbre’s picture

#1894322: Metatag export shows overridden by default could possibly be a related issue.

caschbre’s picture

Issue summary:View changes