Is it possible to group features?
The only reason i have so far for this request is that if multiple features were created improperly...but could possibly prove to be useful in the long run.
A site i'm working has multiple features that could be grouped, and i think that, manually, have to clone views, content types, etc...before creating one big feature that comprises all of the other ones. If i don't clone, i can't reuse the individual CCK and components because Features does not allow them (e.g. a view) to be part of multiple features, and disabling one small feature will remove the content types (along with their CCK fields) from the list.
The opposite, breaking a feature into small ones, could also prove to be useful.
Comments
Comment #1
Grayside commentedOnce you have created a feature, you can always go in to the feature's .info file and set
package = "My Package"this will affect the fieldset it is part of on admin/build/modules, and which section it is in on admin/build/features.UI in the Create Feature interface to specify the package might be worthwhile.
Comment #2
adamgerthel commentedI second this. Grouping features would be a very welcome addition. It's not necessary, but it would make things easier in regards to organizing lots of features
Comment #3
logickal commented+1 to this. We make very granular features, and group them according to site section or functionality by editing the package parameter. I haven't looked yet, but I wouldn't think it would be that hard to expose an optional Package on the Create Feature UI.
Comment #4
logickal commented-Deleting duplicate post-
Comment #5
Grayside commentedThis is a minor priority, but it's also a minor difficulty. All someone needs to do is add a package UI element to the Create form, and then mimic the same code that places the description or project status url into the feature's .info file.
It should be defaulted to Features, and overridden by whatever is in the feature's .info file. This is probably akin to how the others work already.
Comment #6
hefox commentedComment #7
Grayside commentedComment #8
hefox commentedComment #9
tim.plunkettSubscribe.
Comment #10
uniquename commentedsubscribe
Comment #11
olamaekle commented@uniquename: There's a follow button now ;)
I'm surprised this does not already exist. +1 to this.
Comment #12
dajjenMe and my friend StoraH (http://drupal.org/user/644948) have created a patch that adds a field in feature admin page for creating feature that lets you add package for you feature.
Please review this patch
Comment #13
hefox commentedComment #14
tim.plunkettThis line looks vaguely correct, but if it's not, remove it.
Whitespace changes are unrelated, leave them out of this.
See http://drupal.org/node/1354 for proper documentation rules
Don't use single-letter variable names
This looks like testing code
As does this
Comment #15
dajjenThank you for your review.
I'v made the changes you pointed out.
Thank you again for your quick respons.
Comment #16
dajjenRemoved some whitespaces
Comment #17
hefox commentedThanks, few more things
isn't defaulting for existing features looks like, should be something like : !empty($feature->info['package']) ? $feature->info['package'] : 'Features',
Could use a better description; if someone doesn't know what a package is, they won't understand this.
Over 80 chars; move chars above 80 to next line (see coding standards)
Don't see any reason this needs to be considered a private features function (i.e. underscore at beginning).
This is a rather fancy way of doing $all_features[] = $value->info['package']? (missing quotes around package btw),
Annyhow, you foreach gathering all the packages, then you see if they match in another foreach; Seems that can be optimized to a single foreach loops (btw: foreachs are a bit slow, and double btw: don't use foreach ($array as $key => $value when not using $key, it's slower than foreach ($array as $value).
Spacing issues on that concat, '/' . $search_string . '/'
The array merge takes care of this below; leave this line alone (ie leave package => features there for when package is not set -- ie drush).
Comment #18
dajjenHi, thanks for your respons. I have made this changes you proposed.
Comment #19
dajjenchanged description of a field
Comment #20
hefox commentedTwo additions small things from eyeballing (haven't tested the patch yet):
The coding standards changed in d7 for concat spacing, it's now '/' . $search_string . '/', ie have a space on each side of the period.
This should be access arguments => array(whatever the relevant permission is) [don't have features.module open atm to look]). Don't need an access callback (you didn't add one, but since the access argument was referencing an access callback, figured I'd mention that. Access callbacks default to user_access).
Thanks!
Comment #21
dajjenHi and thanks again for all your help.
I hope I have made the necessary changes to this patch.
Comment #22
misc commentedI have tested the patch and it works great for me on 7.x-1.0-beta6.
Just a note - I mark as RTBC, but I work as the same company as @dajjen, so that is a problem, please swtich back to needs review.
Comment #23
Grayside commentedComment #24
Grayside commentedOoops. I thought I was on a completely unrelated issue in the OG queue. Sorry.
Comment #25
dajjenComment #26
zilverdistel commentedWorks for me ...
Not sure if we should require a value for this field ...
Nice work with the autocomplete too! Thanks!
Comment #27
zilverdistel commentedComment #28
mpotter commentedRemoved the Required flag. Committed 6b4b87c
Comment #29
mpotter commentedComment #31
nancydruPlease back port to 6.x.
Comment #32
tim.plunkett