0

I have inherited a site that makes heavy use of Features, and this constrains what I can do to permissions and creates dependencies that don't otherwise exist. Something as simple as turning off the overlay becomes a mystery.

Is there some way I can remove these features and give back control to the database and to dependencies declared in non-Feature modules? I'd sure like to be able to adjust permissions by visiting the usual permissions UI and making the change as per usual.

I see there is a Features Tools module that appears relevant, but it does not seem to address things like roles and permissions. And it's a bit discouraging to think that an additional module might be necessary just to de-Features a site.

  • 2
    That's difficult to tell. Do your Feature modules contain custom code in their module files? Do any Feature modules contain Views or other stuff that's only being declared by code but is not represented in the database? Who knows! Unfortunately this is a too localized issue. I'd recommend to stop to implement new things on the live site from the UI. Instead do that locally and then deploy changes via Feature updates. Just ensure all your live Features are up to date first, by setting up the site locally, import current database dump and then recreating all Features. – leymannx Jan 14 at 15:11
0

When you are absolutely sure there is no custom code in the feature module you can safely recreate the feature by going to /admin/structure/features and then change permissions and/or disable modules such as the Overlay module that are declared as a dependency in the feature.

You can recreate the feature and remove the unwanted components:

  1. Go to /admin/structure/features
  2. Click the 'Recreate' button next to the feature
  3. Uncheck all dependencies or other components that you don't want in the Feature.
  4. Click the 'Download feature' button.
  5. Replace the Feature module in your modules folder.

When you are not sure there is any custom code in the feature module do this on a local environment and check all changed code via Git to make sure only the components you deselected are removed from the feature module.

New contributor
SanderRuisseau is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Take in mind that feautures modules often contain code beside the generated so is possible that you actually turning into somethings breaking so do it carefully and make good use of a VCS to check your changes. – d70rr3s Jan 14 at 13:14
  • 2
    Wowowo, danger here: You can safely disable the feature. You know if the feature modules doesn't include any custom stuff? Or contains things that are only declared via code but are not represented in the database as Views for example? I'd rather prefer recommending to stop to do things on the live site, but do it locally instead and then see what feature module changed. Recreate and push. – leymannx Jan 14 at 15:13
  • Thanks all. Since disabling the feature might not always be safe, maybe the answer should be edited to focus on recreating the feature, and omit the part about disabling the feature? – arnoldbird Jan 15 at 15:08
  • I have edited the answer. I hope this is a better answer now. – SanderRuisseau Jan 16 at 9:41
  • Hate to say it, but I don't think the first paragraph is correct, with this edit. I'm not 100% sure. I think it is always relatively safe to recreate a feature, regardless of whether it contains custom code. Disabling a feature also disables the custom code in a feature module, but recreating the feature does not. Please correct me if I'm wrong! – arnoldbird Jan 16 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.