I'm having a problem trying to export Entities from modules that provide Features support through Entity API. I have the same issue with both the Entity Registrations and Profile2 modules.
See #1418020: Features exportable support for Registration Entity for more info. But essentially the problem is that the exportables only appear to features directly after a cache clear, and when you try to export the entity into a feature, the exportable info disappears mid export, resulting in a Features error "An illegal choice has been detected. Please contact the site administrator". Clearing the cache makes the exportable info visible to features again, but after trying another export it disappears again mid export and the same error prevents the export from completing.
The is with the latest stable release of Registration and Profile2, and the latest git code of Entity API and Features.
Comment | File | Size | Author |
---|---|---|---|
#8 | entity-features-file-key.patch | 719 bytes | Everett Zufelt |
#3 | entity_api_unable_to_export_entities-1419598-3.patch | 876 bytes | mrfelton |
#1 | entity_api_unable_to_export_entities-1419598-1.patch | 329 bytes | lliss |
Comments
Comment #1
lliss CreditAttribution: lliss commentedtim.plunket helped me find a solution to this. Looks like the features integration for entity is only getting loaded after cache clears because it's not explicitly being called from within the entity.module file. An explicit module_load_include seems to fix this. A patch is attached.
Comment #2
mrfelton CreditAttribution: mrfelton commentedThis patch does not resolve the issue for me. No change.
Comment #3
mrfelton CreditAttribution: mrfelton commentedTry with this one. Seems to do it fo me.
Comment #4
fagoThis should be unnecessary as we have the 'file' specified now. Let's keep the features file only included if needed.
Comment #5
mrfelton CreditAttribution: mrfelton commentedWill hook_features_api still be called even if its in the other file, or would that function need to be moved to entity.module? Does the files[] entry in the .info file enable module hooks to be located in files other than *.module?
Comment #6
fagoNop, that's done via hook_hook_info() of the features module. I ran into the issue myself and was able to verify that the patch of #3 minus the line mentioned in #4 works.
-> Committed, thanks.
Comment #8
Everett Zufelt CreditAttribution: Everett Zufelt commentedAdding patch that includes only first hunk from #3.
Comment #9
jackbravo CreditAttribution: jackbravo commentedThis is not working for me with latest dev. The 'file' key on hook_features_api doesn't seem to imply that you can put your hook_features_api implementation also in that file.
For me only moving hook_features_api function to the .module file solves the issue. The entity that I'm trying to export is a search_api entity.
Comment #10
jackbravo CreditAttribution: jackbravo commentedCould this issue be the culprit? http://drupal.org/node/977052