I've got a good example of this going with riat right now.

http://github.com/EclipseGc/riat

If you create a definition and then manage it, you can add relationships to the definition. Features will allow you to export both the definition and the relationships (both are currently labeled riat_core on the features select drop down, the second one is the relationships). These will export to code just fine (didn't even do that in beta 11) but they are still missing from info file.

Use case:
I have a unique name/child id set of columns within the table structure, but ctools isn't keen on using a compound unique key, so I provide an rid as a serial, and then throw it away in the export (merlin actually advised me to do exactly this). The problem being that since features is keying on the primary key in my export, I'm only going to get the serial in the list. List callbacks allow me to change that for the better, but once I use it, features stops liking it. :-(

Eclipse

Comments

eclipsegc’s picture

Version: 6.x-1.0-beta12 » 6.x-1.0-rc1

Sorry mis-marked the version.

eclipsegc’s picture

Priority: Major » Critical

ok, so apparently got my wires crossed on this because the exported file doesn't appear to be there either, so the $module.default_hook_name.inc for an exportable with a custom list callback doesn't get created in addition to the the info file issue.

eclipsegc’s picture

After looking into this a little more, it appears that hook_features_export_render() is not being called for components w/ their own list callback. Still trying to nail this one down.

eclipsegc’s picture

Assigned: Unassigned » eclipsegc
Status: Active » Needs review
StatusFileSize
new739 bytes

The ACTUAL problem here is that features makes use of ctools_export_load_object(), which if a custom 'list callback' is utilized will probably not resolve (since the list is probably no longer keyed on the primary key of the system). Further more it doesn't actually make use of the custom 'load callback' available in export which ctools_export_crud_load() now does. So I've switched the system to utilize that instead, they return nearly identical data, so this was very easy to do. Then a custom load callback for my weird exportable makes everything go back to working properly. I have my proper file for the hook, and items in my info file so this makes me very happy.

Earl had mentioned to me that ctools_export_load_object() needed to be switched to ctools_export_crud_load() if possible, so I'm pretty sure this should be our method going forward if possible.

Hope this all makes good sense to everyone else.

Eclipse

eclipsegc’s picture

StatusFileSize
new801 bytes

Earl pointed out to me that I was creating an array and destroying it. Sorry wasn't paying attention was just trying to produce identical output.

yhahn’s picture

Status: Needs review » Needs work

Looks good, but if possible I'd like to have a fallback to calling the load callback directly to ensure that people using CTools < 1.7 don't crash and burn.

yhahn’s picture

Status: Needs work » Needs review
StatusFileSize
new5.27 KB

Rerolled patch, this uses wrapper functions to contain the version checking craziness that can be deprecated once CTools 1.7+ becomes widespread.

yhahn’s picture

StatusFileSize
new5.65 KB

Properly use list callback for options.

yhahn’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.