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

xano’s picture

Include file troubles.

fago’s picture

Status: Needs review » Closed (works as designed)

Well, features has the 'file' key for that in hook_features_api() which we are using - so that should be just fine.

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.

Sounds like a bug in features then.

xano’s picture

Ah, 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.

hefox’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new0 bytes

The 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.

hefox’s picture

StatusFileSize
new1.17 KB

Patch was blank, oops.

hefox’s picture

StatusFileSize
new1.17 KB

Extra new lines

hefox’s picture

Status: Needs review » Closed (works as designed)

Nevermind.

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.

Everett Zufelt’s picture

Status: Closed (works as designed) » Active

Can anyone provide the issue # / patch that fixes this in entity?

hefox’s picture

Status: Active » Closed (works as designed)

Can 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.

jackbravo’s picture

This 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.

jackbravo’s picture

Could 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?

xano’s picture

Assigned: xano » Unassigned