Modifying, updating and reverting Features

Last updated on
23 December 2016

Once you've got a feature installed and running, chances are that you'll want to fiddle with it and change some of its settings. This is quite natural, and nothing to be afraid of. The Features module will notice any changes made to a component of any features and signal this with an Overridden state on the Features administration page.

Moreover, the Features module will allow an administrator to inspect the changes, revert to the original state and also to update the feature by applying the new changes to it (thereby possibly branching the feature). Here's how it works:

  • The View option displays a crude list of all the settings in the feature. If you have the Diff module installed, you can also use the Compare option to see what has been changed in a more convenient way.
  • The Revert option presents a list of the changed components in the feature, allowing the administrator to uncheck any of them before reverting the rest to its original state.
  • The Update option is identical to the Create feature page (read more), with the exception that fields and the component list are pre-populated.

"Revert" vs "Update"

Use one of these operations if the configuration on your site (living in the database) differs from the definitions in your feature module (living in code).

This operation changes your site configuration (living in the database) to match up with the definitions in the feature module code.

In some cases (e.g. views), the revert operation will delete the respective configuration in the database, so the system will instead use the default configuration that is defined in the feature module's code.

Update / Recreate

The update operation will produce a modified version of your feature module, which matches up with the configuration found in the database.

What happens with this modified code, depends on whether you do this with drush or with the web-based interface.

If you update the feature via drush ("drush features-update [name]"), the modified code will replace your existing feature module in the filesystem.

The "recreate" button in the web-based administration interface is equivalent to "update". However, the modified code will be provided for download as a .tar archive, instead of overwriting the existing feature module. It is up to the site builder to manually unzip and re-upload the modified module, replacing the original.

The different states of a feature


The 2.x branch of Features introduced a UI for "locking" either individual component types of a given feature or the feature as a whole by clicking on a lock icon. Clicking the icon again will unlock the feature or component type.

While component types can be locked in a given feature, there is no way of locking individual items. For example, you can lock all views in feature_x, but can't lock only a single view.

A feature or component that is "locked" may show as overridden but will not revert, even if features revert is called. Thus, locking is a simple way to protect specific changes from being lost when features are reverted.