When viewing custom entities, hook_entity_view_mode_alter doesn't fire because core triggers it for core entity types in each entity's build_content function (node_build_content, etc.). Seems to make sense to add this to entity_build_content.

Patch attached.

CommentFileSizeAuthor
entity-add_view_mode_alter.patch686 bytestauno
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chris Matthews’s picture

Issue summary: View changes

The 5 year old patch to entity.module applied cleanly to the latest entity 7.x-1.x-dev, but still needs review.