In D7, there is a feature allowing modules to be hidden from admin pages, which means that if a module is disabled and then hidden, there is no easy way to enable it via admin UI.
I have a situation where in there are some features that i would like them to live in the codebase in a disabled state, I also manually set the hidden = true in .info file so that the features are not displayed for site admin page.
However the features page still displays them in features list and also shows them as conflicts.
There should be a way to say features "x/y/z" can live in the code base but shall not be displayed in UI and not considered when looking for conflicts.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | features-n1187232-17.patch | 592 bytes | damienmckenna |
| #15 | features-info-hidden-02.diff | 592 bytes | smokris |
| #13 | features-info-hidden-01.diff | 576 bytes | smokris |
| #11 | features-info-hidden-00.diff | 603 bytes | smokris |
| #8 | 1187232_hide_features_with_hidden_value_set_3.patch | 721 bytes | rickvug |
Comments
Comment #1
Ravi.J commentedOn closer look, it does hide the feature from displaying on the Features admin form, however does not consider the hidden + disabled settings when checking for conflicts.
Comment #2
Ravi.J commentedPatch attached
Comment #3
rickvug commentedWith the patch applied I get the following errors on install:
Comment #4
Ravi.J commentedRevised patch, missed out on include features.admin.inc
Comment #5
rickvug commentedThanks @Ravi.J. The updated patch works as advertised. What may be needed however is a check to see if the hidden module has already been enabled. Beyond this I don't see any problem.
Comment #6
rickvug commentedComment #7
febbraro commentedComment #8
rickvug commentedAttached is the patch re-rolled against dev.
Comment #9
febbraro commentedCommitted to 7.x thanks. http://drupalcode.org/project/features.git/commit/abe692f
Comment #11
smokrisThis is also a problem in features-6.x-1.x.
Patch attached, which hides modules from
admin/build/featureswhen the module's.infofile hashidden=TRUE.Comment #12
hefox commentedNote for those who didn't know hidden was in 6.x: it was added about a year ago as a backport due to simpletests.
Small coding standards issues
White space issues (line before the foreach has two extra spaces) and spacing of control structure
(Well the isset vs not empty isn't coding standards, but equivalent and a bit shorter)
(thanks for the patch, etc., smokris)
Comment #13
smokrisGood point — I replaced the
isset()withempty(). New patch attached.Not sure what you're talking about regarding there being extra whitespace — I don't see two extra spaces in line before either
foreachin my previous patch. Going through the checklist on http://drupal.org/coding-standards#indenting: I'm using 2 spaces to indent, I don't have any trailing whitespace, I'm using \n.http://drupal.org/coding-standards#controlstruct says that using frivolous curly braces is "strongly encouraged", but not required. I chose not to use frivolous curly braces, because in my opinion they decrease readability in very simple cases like this (and would add two extra lines to a three-line patch). I don't see any conflicts with the coding standards for control structures.
Comment #14
hefox commentedWas browsing the patch too fast; you're right on there being no extra space, sorry for the confusion!
The coding standards have suddenly changed from "strongly encouraged" to "always", so switch em (for the if and foreach)? Pretty please with a cherry on top!
Once that's done, one passing review and this should be RTBC
Comment #15
smokrisWow. "Suddenly changed," eh? Quite a coincidence.
I've attached the patch again, now with curly braces.
Comment #16
mpotter commentedI am reverting this patch in the 7.x-1.x branch because it prevents a hidden Test feature from working (tests fail). After removing this patch I still do not see hidden features in the UI and do not see them in the conflicts. Maybe this is related to the changes in the 1.1 UI. If people discover that there is still a case where a hidden and disabled feature still shows as conflicts, please let me know.
It's possible the D6 patch is still useful, but not for D7.
Comment #17
damienmckennaThis is 100% identical to #15 only has the correct filename to trigger the testbot.
Comment #18
damienmckennaRTBC, forgot that testbot doesn't work on D6.
Comment #19
hefox commented