I'm working on modules ( used within a distribution ( These modules are based on Features.
Features is great to export our config and setup a fresh Drupal installation but we have problems when it's time to update a module...

Proposed resolution

Here what we tried in hook_update_n():

Revert the whole module
it does not work because it will overwrite changes made by the user on his site (like Views or Content Types).
Revert only non-overridden components
it does not work because I can't make the difference between changes made by the user (so only in DB) and changes in code of the new version of our Feature. In both cases the feature state is overridden.
Do all updates manually without Features
Maybe the worst solution, but the only one that seems to work... For example, if I added a CSS class to an existing Views, I will have to add it manually without using Features in hook_update_n().
Use Features Override
As suggested in #2, use Features Override to export changes made by the user

What is your approach for updating modules built with Features?

Thanks in advance!


re-present’s picture


Sheldon Rampton’s picture

Have you tried the Features Override module?

cthiebault’s picture

Yes I'm finally using Features Override but it not very transparent for the user...
If I'm correct, the workflow should be

  • before an update the user has to create a new Features with all the changes he made to our Features,
  • then do the update
  • and revert his changes with his Features Override.

I was looking for something more transparent and requiring less work for the end user...

cthiebault’s picture

Issue summary: View changes

Add features override as suggested in #2

cthiebault’s picture

Issue summary: View changes

fix comment number