Since eva is now supposed to have the ability to work with any type of entity, I created a view that would get attached to taxonomy terms. When I go to display settings, I see that I can set where it appears and that all seems to work. However, when I go to the actual term page where this would appear, it doesn't show up. I tried it with setting some dummy header content to get shown without any luck. In trying to figure out what is going on, I found out that the taxonomy module doesn't actually invoke hook_entity_view so nothing can actually tie into it! While it seems like a core bug in some ways, it also seems like perhaps the better way to solve this would be by implementing the functionality in hook_entity_views_alter? As a note, comment, user, node are the only entities that invoke hook_entity_view. Any other entities would have to invoke it for what is currently there to work.
Comments
Comment #1
btmash commentedOk..so I figured out a way around it. But I can now see why eva did not go the route of hook_entity_views_alter or something else - the entity variable across the various modules that implement that are inconsistent (see #1170198: The build variable name for the entity should be the same regardless of type of entity.). So my solution to show taxonomy fields from eva was as follows:
Any help from the community regarding this issue would be greatly appreciated.
Comment #3
eaton commentedBTMash, thanks for the patch. I'm definitely going to give it a spin: I did switch it to use a special case for each entity type that requires this handling; there's little enough code that's shared across the cases, and I figure it can be refactored once a second or third example of this pattern appears.
Comment #5
kiramarch commentedIs this patch included in the latest version of EVA? I'm experiencing the same problem (described in good detail here), and I'm using 7.x-1.2. Thanks!
Comment #6
mkadin commentedYes, the use of hook_entity_view_alter() is central to EVA at this juncture.
Comment #7
kiramarch commentedSo, mkadin -- does this mean the problem that I'm seeing is a new one?
If so, would it be appropriate to re-open this thread? And what other info can I provide to help illuminate the problem? Thanks!
Comment #8
mkadin commentedYeah, I think this particular issue is settled. Please re-open another issue, preferably with a good description of your fields / content types and an export of your view.