Drupal features feature module version update
In the previous lesson, we looked at how to create feature modules for Drupal. In this lesson, let’s go over how to update those modules by adding new functionality.
We have a feature module versioned as alpha1. Now we’ll create the next version, alpha2. In the News block, we’ll add a publication date and teaser in addition to the title. First, copy the folder of the alpha1 feature module into sites/all/modules
, but do not enable it yet. This allows us to recreate the feature.
Before that, update the View that displays the news block. Add the "Post date" and a trimmed "Body" field (limited to 100 characters). Save the View.
The updated news block will now look different.
Now go back to the Features admin page and recreate the feature module (as shown in the earlier screenshot). The only change will be the version number since we didn’t add new Views or content types—just updated an existing View. Click Download feature.
Save the archive of the updated feature module (version alpha2). Install this new version on another site that still has the old alpha1 version. Replace the old module with the new one. On the new site, go to the Features page, find your feature module, and click “Overridden”.
Drupal automatically detects differences and shows that the feature module has been changed. You can now revert it to match the updated module version.
Finally, clear the cache. Your News block on the new site will now reflect the updated structure from the new feature module.