Download & Extend

Unable to use custom templates for themeing EVA views [WORKING PATCH PROVIDED]

Project:EVA: Entity Views Attachment
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

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?

Comments

#1

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.

#2

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

#3

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);

#4

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

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
AttachmentSize
allow_themeing-1205008-4.patch 1.02 KB

#5

The above patch does resolve the issue for me.

#6

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

#7

I can confirm the patch works as well.

#8

patch works, thanks!

#9

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.