Closed (works as designed)
Project:
EVA: Entity Views Attachment
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2013 at 17:26 UTC
Updated:
22 Sep 2016 at 18:32 UTC
Jump to comment: Most recent
Comments
Comment #1
mkadin commentedMickey, EVA should still display the view. I've just tested it on a local dev environment for me and it showed up just fine. Have you successfully gotten the view to show up when there are results? Perhaps that's the issue, and not the no results behavior.
Comment #2
micnap commentedHi,
Yes, the view shows fine where there is content to display. It is used on a custom entity type created by a third party module (Redhen) though, and not a standard node, if that makes any difference. I've just discovered hook_menu_local_tasks_alter, however. I'm thinking that may be the better way to go in this instance rather than hard-coding the link.
Thank you for the quick response!
Mickey
Comment #3
mkadin commentedWell that does sound like a bug then...It could be related to the custom entity, but if it is successfully attaching when there is content then it'd be weird to only show up when there's no view results.
If you want to help me track it down, maybe you could spend a few minutes dsm()'ing inside eva_entity_view_alter() in eva.module. I'd be interested to see the results of calls to _eva_extract_entity_from_build($build), eva_get_views($type), and $view->execute_display($info['display']).
Comment #4
micnap commentedWell, the local_tasks_alter didn't work out so well, so I'm back to this.
I traced it all the way down to the eva_plugin_display_entity class. In the execute() function, the three eva views I have on the site ARE being rendered. But $data isn't being returned because none of the conditions in this:
if (!empty($this->view->result) || $this->get_option('empty') || !empty($this->view->style_plugin->definition['even empty'])) {is true. I'll trace it further tomorrow.
Thanks,
Mickey
Comment #5
micnap commentedThe trick to getting the view to show is to use the No Results Behavior settings under the Advanced section in the view, NOT the No Results Behavior setting under an individual field in a view.
Fixed.
Dupal - 9,345 : Mickey - 0
[banging head on desk]
Comment #6
windmaomao commentedi found a even better way, add a custom text field to he No Results Behavior, and then add a space there just to trigger view display.
then you can use header or footer as used to be.
Comment #7
annie2512 commented#5 resolved my issue. Now when view has no results, it display the content in No Results Behavior settings under the Advanced section. Thanks @micnap