0

I have an issue with Features which contains a view. If I update the feature and then clear the Drupal cache, the view will revert to the configuration in the updated feature.

My understanding was that a feature would not be reverted unless it is specifically made to (e.g. manually revert the feature). Is this a wrong assumption?

Here is more information of what I have tried. On server A, I modify a view which is contained in a feature. I then update the feature so that it contains the modification to the view. I then commit the updated feature to git.

Now, I log into the other server, and pull in the changes from git (e.g. bring in the updated feature). If I go to the feature's admin page I can now see that it is overridden (so far so good).

I then clear the drupal cache (e.g. via performance page or drush cc all). If I now check the feature status, it is set to default and the view has also been modified.

Why would the feature and the view change on cache clear if I haven't specifically reverted the feature?

UPDATE: It seems the issue only occurs if the status of the feature on Server B was 'default' prior to deploying the updated feature. See following scenarios:

SCENARIO 1: Feature on Server B is in 'default' state. Updated feature from Server A is deployed to Server B. The features admin page shows on Server B now shows the feature to be "Overridden" (expected given we have deployed updated feature).

If I now clear cache, the feature's status has now changed to 'default' and examination of the relevant view shows that the changes in the updated feature have been applied.

SCENARIO 2:

Feature on Server B is already in 'Overridden' state, due to a local change I made to the view. The updated feature from Server A is deployed to Server B. The features admin page shows feature on Server B to be "Overridden" (expected given we made local changes to relevant view).

If I now clear cache, the feature is still shown as "Overridden" and the relevant view has not been altered.

As you can see in SCENARIO 1 the updated feature is automatically reverted on cache clear, but in SCENARIO 2 it is not.

1

This is not supposed to happen, a cache clear should not have any effect on overridden features.

I'm just guessing here, but have you tried to uncheck the option 'Rebuild features on cache clear' on the features settings page (admin/structure/features/settings)?

Rebuild and revert are two different things where rebuild should leave the overridden features as they are, but who knows? It's worth the try.

  • Thanks for reply. I am not able to find the features' settings page you refer to. – Benjen Nov 12 '15 at 2:33
  • On the features overview page, there is a tab in the top right corner. You can also go to yoursite.com/admin/structure/features/settings – Patrick Scheffer Nov 12 '15 at 14:39
  • What version of features are you using. The path you mentioned does not seen to exist. I checked the features source code and could not find any reference to it either – Benjen Nov 12 '15 at 21:51
  • That's strange. I used version 2.5 but updated to 2.7 after reading your comment and the settings page is still there. I also checked the code and as you can see here admin/structure/features/settings is defined in hook_menu. Just to make sure we're on the same level: you're using Drupal 7 with Features 2.7, right? – Patrick Scheffer Nov 16 '15 at 8:20

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.