Closed (fixed)
Project:
Display Suite
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Jun 2011 at 10:39 UTC
Updated:
4 Jul 2011 at 21:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
mrfelton commentedIt seems that Display Suite provide 2 different types of export. Once contains the implementation of hook_ds_field_settings_info() and the other contains hook_ds_layout_settings_info().
They are both titled as 'Display suite' in the features admin interface when creating a feature. It's pretty confusing a we have no idea which one we need, or what the difference is between the two. Perhaps they should be called 'Display Suite Fields' and 'Display Suite Settings'?
Comment #2
swentel commentedSo in the end styles are exported right ? The name comes automatically through the CTools and features integrations. I'll investigate if I can change those names somewhere.
Comment #3
mrfelton commentedYes, they styles do get included if you include both of the exports for your content type that are provided by Display Suite. However, what doesn't get included is the actual list of styles, but thats because they are stored in a system variable, so I was able to include them manually with strongarm.
Comment #4
swentel commentedOk, there's nothing I can do about this, the code in features.ctools.inc looks for the module name
CTools' bulk export module is clearer though on its own export screen.
Comment #5
mrfelton commentedI just found a way to do this whilst working on exportable support for the Bean module. See #1160056: Make Bean types exportable specifically my notes in http://drupal.org/node/1160056#comment-4623828
You need to implement hook_features_api to override the default CTools implementation.
Comment #6
swentel commentedI don't see the features.inc file in that patch, so not sure what I'll have todo there. Bit lazy to find out right now too hehe.
Also, I'm skeptical about this, since I'd rather see this fixed in CTools - say adding an extra key in the export function and features looking for it, because what's the point of using export api and still having to implement a hook for features, so I'm really tempted to set this to won't fix.
Comment #7
swentel commentedCTools has a key name that can be added to the export key in the schema. A simple patch for features looking for this would solve this for a lot of modules, and less code to maintain for everyone :)
Comment #8
mrfelton commentedAh, ok I forgot to include the features.inc file in my patch. Although, nothing in there is relevant to this at all - it only contained an implementation of
hook_features_pipe_MODULE_alter(). The only bit relevant to this the following where features.ctools.inc's default hook_features_api implementation is overridden to provide a name that differs from the module name.Please don't mark this as won't fix. It's really bad UX at the moment as in the features admin ui you have two items named identically which is very confusing. Features prvides the ability to override the default CTools hooks for exactly this reason - so that you can customize them if need be. hook_features_api is a very basic hook with only about 8 lines of code that returns an array. You could even call the default hook implementation in your code to get the default array as returned by features.ctools.inc and then just override the 'name' key. Something like
I like your idea about patching features to support custom naming out of the box though.
Comment #9
swentel commentedIt's actually possible to have 4 different Display suite select boxes :)
Patch attached, can you check ? Seems to work fine here.
Comment #10
mrfelton commentedYeah, that seems t do the job. Nice one.
Comment #11
swentel commentedAlright, committed and pushed.