Skip to content

Instantly share code, notes, and snippets.

@sagotsky
Last active December 14, 2015 23:09
Show Gist options
  • Save sagotsky/5163621 to your computer and use it in GitHub Desktop.
Save sagotsky/5163621 to your computer and use it in GitHub Desktop.
Notes for how to revert a feature only if it isn't overriden.
<?
require_once(drupal_get_path('module', 'features')) . '/features.export.inc';
$features_components = features_get_component_states(array('vsite'));
if ($features_components['vsite']['field'] == FEATURES_OVERRIDDEN) {
features_revert(array('vsite' => array('field')));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment