I am using EVA to display my gallery view on my gallery nodes. When I override the display output I get the following errors:

Notice: Undefined variable: title in include() (line 31 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: header in include() (line 35 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: exposed in include() (line 41 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: attachment_before in include() (line 47 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: rows in include() (line 53 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: empty in include() (line 59 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: pager in include() (line 65 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: attachment_after in include() (line 69 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: more in include() (line 75 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: footer in include() (line 79 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).
Notice: Undefined variable: feed_icon in include() (line 85 of /../sites/all/themes/../templates/eva-display-entity-view--gallery--entity-view-1.tpl.php).

When I clear the cache my view displays fine, but if I refresh it disappears and I get the above erros. Any idea what could be wrong?

CommentFileSizeAuthor
#4 allow_themeing-1205008-4.patch1.02 KBgirishmuraly

Comments

tragic.rich’s picture

Update:
The display override works fine if I use the lowest level possible: eva-display-entity-view.tpl.php
But anything higher than that and the display breaks and I get the above errors.

peterpajchl’s picture

Facing the same issue.

When I create new custom template file for eva display, the first time (after flushing caches) it displays correctly but afterwards it throws an error "Undefined Variable".

girishmuraly’s picture

The issue seems to be that template_preprocess_views_view() is not run.

Temporary workaround would be to place this code in the custom template file:

$vars['view'] = $view;
template_preprocess_views_view($vars); 
extract($vars);
girishmuraly’s picture

Title: Undefined Variable » Unable to use custom templates for themeing EVA views
Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.02 KB

There was a hard dependency on eva.theme.inc even when overriding eva-display-entity-view.tpl.php to a custom tpl. The attached patch aims to fix this by removing the dependency from hook_views_plugins() as it should be free to discover and take the themeing route it wants.

Also noticed that the following are unnecessary in the .info file:

files[] = eva-display-entity-view.tpl.php
files[] = eva.module
files[] = eva.theme.inc
files[] = eva.views.inc
peterpajchl’s picture

The above patch does resolve the issue for me.

smira’s picture

Status: Needs review » Reviewed & tested by the community

i can confirm that this patch fixes the issue for me as well, commit to dev imo!
ps. i patched against eva-1.1

simon georges’s picture

I can confirm the patch works as well.

valderama’s picture

patch works, thanks!

mxt’s picture

Title: Unable to use custom templates for themeing EVA views » Unable to use custom templates for themeing EVA views [WORKING PATCH PROVIDED]
Priority: Normal » Major

Patch in #4 works very well also for me.

Can this be committed please?

(has been almost a year after the first report)

Thank you very much.

mkadin’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Looks good. Committed to dev branch...stay tuned for a new release. Thanks all!