In order to avoid conflicts between features I use, where possible, features_component_alter_hooks. For example, in Open Atrium, if I need to override the "administer users" permission (exported by Atrium feature) I would implement:

function MYFEATURE_user_default_permissions_alter(&$permissions) {
  $permissions['administer users'] = array(
    'name' => 'administer users',
    'roles' => array(
      '0' => 'administrator',
      '1' => 'manager',
    ),
  );
}

I was wondering if it wouldn't be possible, for the Features module, to automatically generate features_component_alter_hooks (in the same way it generates default_hooks) when a potential conflict is been detected.

If this would be the case the Atrium feature could be marked with another status, something "less" then "Overridden", like "Altered" or "Extended". Such a change could involve the UI too where the "alterable" component could be presented to the site builder in a different way, like:

administer users (alterable)

Does it make sense? If there is any interest I could spend some time on it.

Comments

ademarco’s picture

Title: Automatic generation of features_component_alter_hooks » Automatic generation of features_component_alter() hooks
Version: 6.x-1.x-dev » 7.x-1.x-dev

Pushing up this issue after DrupalCon London BOF.

hefox’s picture

isn't that what features_overrides module does?

ademarco’s picture

Right, I had just promised people at the BOF to push up the issue for review.

hefox’s picture

Status: Active » Fixed

Yea this is features overrides, so closing this.

hefox’s picture

Category: feature » support

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.