The apachesolr module (for example) lets me add my apachesolr environments to a feature. It also has code specifically intended to make it possible for users to override the settings of an apache solr environment by adding a $conf variable to settings.php. For example:

  // change solr url for local testing
  $conf['apachesolr_environments']['opensolr']['url'] = 'http://localhost:8080/solr/mysite';

The problem is that when i take advantage of both these options my feature - the one that includes my apachesolr environment - is (correctly) marked as overridden even though I dont want it to be. Is there some hook somewhere that I haven't figured out to let features know what is going on here? Some way to tell features to ignore certain things when deciding if a feature is overridden?

Comments

hefox’s picture

No, not really. I'd be open to adding a hook for this, but from what I recall when looking into something similair it'd be quite painful to detect (basically similair to what happens when an alter hook is used).

There is a feature request somewhere to 'lock' certain features (prevent reverting/rebuilding), but that's not this

bleen’s picture

That makes me sad ... to work around this we added this to settings.php:

$using_features_admin = (arg(0) == 'admin' && arg(1) == 'structure' && arg(2) == 'features');
$using_drush = (isset($_SERVER['argv'][0]) && strpos($_SERVER['argv'][0], 'drush.php') !== FALSE);
$using_drush_features = FALSE;
if (isset($_SERVER['argv']) {
  $features_commands = array('fd', 'fa', 'fc', 'fe', 'fl', 'fr', 'fra', 'fr-all', 'fu', 'fua', 'fu-all', 'features-add', 'feature    s-components', 'features-diff', 'features-export', 'features-list', 'features-revert', 'features', 'features-revert-all', 'featur    es-update', 'features-update-all');
  $using_drush_features = array_intersect($features_commands, $_SERVER['argv']);
}

if (!$using_features_admin && !$using_drush_features) {
  $conf['apachesolr_environments']['solr_env']['url'] = 'http://localhost:8080/solr/mysite'';
}
bleen’s picture

Issue summary: View changes

Updated issue summary.