i'm not sure if this functionality already exists: how to remove an existing field / an existing component using features override?
when i delete the field i can't select it as an override so i was wondering if it was possible and how to implement such functionality?
thank you, josef
Comments
Comment #1
dasjoi tried to "fake" an override, but the following code doesn't work. the base feature would still list the field as overridden due to removal
Comment #2
nedjoHi Josef!
Yeah, this isn't possible currently with Features Override. You could do it in a custom default hook alter. E.g.
It would still show up as an override. This is due to a bug in Features. See point 3 in this comment: #1277854-49: Faciliate altering features, e.g., export field display settings separate from field data structure ("One case is adding or removing components...").
Comment #3
dasjohi nedjo, i see, the hook alter we're using right now, but as you stated, unfortunately the component will be marked overridden. would you consider this a feature request of features override then?
Comment #4
nedjoI think it has to be fixed in Features. I opened an issue, #1345174: Alter hook implementations lead to false overridden status for features components. I sketched in some tests to detect the bug. If you or anyone else happens to have time to fill in the tests or draft a fix, please go ahead....
Comment #5
dasjogreat thank you nedjo, i will be following the features issue
Comment #6
nedjoTested a bit more and I was wrong--the info data returned by
features_get_features()is altered. So if you implement a default hook alter as in #2, and then unset the element inhook_system_info_alter(), your feature shouldn't show as overridden. Like this:Comment #7
jec006 commentedThis now seems addable from the UI, however, the unset is not properly added to the override module.
Comment #8
jec006 commentedComment #9
candelas commentedIt would be nice to have this feature :)