Several implementations of Features hooks/callbacks (features calls them hooks, but doesn't fully treat them so) are located in entity.features.inc and are therefore not callable by Features' custom hook/callback invocation code, which does not work with include files.
One example of a problem caused by this bug is that exportable entities don't appear at Features' "Create feature" page, because the file Entity's implementation of hook_features_export_options() lives in, is never included.
The attached patch moves these implementations to entity.module.
Comments
Comment #1
xanoInclude file troubles.
Comment #2
fagoWell, features has the 'file' key for that in hook_features_api() which we are using - so that should be just fine.
Sounds like a bug in features then.
Comment #3
xanoAh, my bad.
Also, Entity 7.x-1.x-rc1 doesn't use the "file" key yet. I updated to dev (which does) and the problem was solved.
Comment #4
hefox commentedThe file key is there, but hook_features_api is in the file that needs to be included so there's no way it's getting called @.@. Not sure how it worked before, but it's defiantly broken now.
Patch moves just hook_features_api. Appears to be working on dev of features and entity with this patch.
Comment #5
hefox commentedPatch was blank, oops.
Comment #6
hefox commentedExtra new lines
Comment #7
hefox commentedNevermind.
Just learned about autoloaders and changes to module_implments and hook_hook_info.
Dev version of entity fixes this bug by adding the file key.
Comment #8
Everett Zufelt commentedCan anyone provide the issue # / patch that fixes this in entity?
Comment #9
hefox commentedCan use git blame to figure out this information (if know the line changed), i.e. go to repo viewer, click blame on file http://drupalcode.org/project/entity.git/blame/refs/heads/7.x-1.x:/entit... which reveals http://drupalcode.org/project/entity.git/commit/54623677688f79c68067810b..., Issue #1419598: Unable to export entities from modules that provide Features support through Entity API by mrfelton, fago: fixed compatibility with the latest features module for exporting entities via features.
Comment #10
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 #11
jackbravo commentedCould this issue be the culprit? http://drupal.org/node/977052
I'm double posting here: http://drupal.org/node/1419598#comment-6846876, which one should I use?
Comment #12
xano