Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When a custom permission is added to a feature module, and the permission is selected (checked) when this feature is recreated, then the feature module will add itself as a dependency.
For example, when I create a permission this way:
function uw_ct_article_permission() {
$permissions = array();
$permissions['use workbench_moderation archive content tab'] = array(
'title' => t('Use "Archive Content" workbench tab'),
);
return $permissions;
}
the feature wants to make itself a dependency. please find the attached screenshot.
Comments
Comment #1
hefox CreditAttribution: hefox commentedShould probably not be even allowed to select on the recreate form. Probably not a permission specific thing, _features_populate likely.
Comment #2
kpaxman CreditAttribution: kpaxman commentedI think you need to be able to select the permission. You are creating the permission itself inside the feature, but you are configuring what roles are assigned to it in the GUI and exporting that configuration to the selfsame feature.
Comment #3
hefox CreditAttribution: hefox commentedI mean, should not be able to select the current module as dependency imo
Comment #4
kpaxman CreditAttribution: kpaxman commentedI just happened to be looking at features.user.inc and I see the following:
If the if statement checked to make sure that $map[$perm] was not the name of the feature itself, this problem would probably go away. (But I haven't tried this as yet.)
Comment #5
hefox CreditAttribution: hefox commentedImo better to fix it in features.export.inc as other's might make the mistake, unset it it it's been added.
Comment #6
NitebreedIssue is still active imo.