Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
I'm working on modules (http://drupal.org/project/mica) used within a distribution (http://drupal.org/project/mica_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!
Comments
Comment #1
globefox CreditAttribution: globefox commentedfollowing
Comment #2
Sheldon Rampton CreditAttribution: Sheldon Rampton commentedHave you tried the Features Override module?
http://drupal.org/project/features_override
Comment #3
cthiebault CreditAttribution: cthiebault commentedYes I'm finally using Features Override but it not very transparent for the user...
If I'm correct, the workflow should be
I was looking for something more transparent and requiring less work for the end user...
Comment #3.0
cthiebault CreditAttribution: cthiebault commentedAdd features override as suggested in #2
Comment #3.1
cthiebault CreditAttribution: cthiebault commentedfix comment number