I'm getting strange warnings about missing files in Entityreference module and vast majority of my views are not showing up on the website:
Warning: include_once(/home/mysite/public_html/sites/all/modules/entityreference/entityreference.views.inc)
[function.include-once]: failed to open stream: No such file or directory in theme()
(line 957 of /home/mysite/public_html/includes/theme.inc).Warning: include(/home/mysite/public_html/sites/all/modules/entityreference/views-view-unformatted.tpl.php)
[function.include]: failed to open stream: No such file or directory in
theme_render_template() (line 1397 of /home/mysite/public_html/includes/theme.inc).
The strange thing is that entityreference.views.inc file is acctualy located in .../entityreference/views/ folder.
To remedy this I just moved entityreference.views.inc to .../entityreference/ folder. I also created blank views-view-unformatted.tpl.php file and put that file to .../entityreference/ folder.
That worked, I'm not getting any warnings, my views are working, but I'm not happy with that solution. Just want to know why is this happening and how can I fix it properly without hacking the module?
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | paths_to_included_files-2170193-8.patch | 641 bytes | dasginganinja |
Comments
Comment #1
daniel_j commentedThe "path" and "theme path" elements in entityreference_views_plugins() need to be set (this function is declared in views/entityreference.views.inc). Views isn't smart enough to use the 'path' member declared in hook_views_api() to look for plugins, so the path has to be explicitly declared.
Comment #2
daniel_j commentedComment #3
daniel_j commentedComment #4
daniel_j commentedComment #5
Jeroen94 commentedI'm having exactly the same problem and solved it by moving the
entityreference.views.incfile to the requested folder. I applied the patch, but it didn't fully work for me. I'm still getting the following errors:Warning: include(C:\wamp\www\mysite/sites/all/modules/entityreference/views/views-view-unformatted.tpl.php): failed to open stream: No such file or directory in theme_render_template() (line 1517 of C:\wamp\www\mysite\includes\theme.inc).Warning: include(): Failed opening 'C:\wamp\www\mysite/sites/all/modules/entityreference/views/views-view-unformatted.tpl.php' for inclusion (include_path='.;C:\php\pear') in theme_render_template() (line 1517 of C:\wamp\www\mysite\includes\theme.inc).Comment #6
Jeroen94 commentedStill a problem in the latest version 7.x-1.2. Clearing caches removes the errors that I got 2 years ago.
Comment #7
dasginganinjaI am experiencing also this particular issue on an install and I can't seem to figure out what the cause of this is. When applying the patch above in #3 I was able to get the errors on cache clear to go away but the errors surrounding the views templates were still present. I have found a solution though.
The solution for this is to simply move the entityreference.views.inc file from /views to /. I have attached a patch against 7.x-1.2+13-dev / latest 7.x-1.x-dev that fixes this behavior in all cases that I have seen to date.
Comment #8
dasginganinjaI stand corrected. I attempted this on a multisite installation and the results were troubling at best. After moving the file to the root directory of the module, the views I had on the sites with existing relations were now broken and not resolving the correct file.
Approaching it from the start, my warnings that I receive are as follow:
The issue here is that the theme path for the views plugin is not set. The patch in #3 is on the right track but we need to give it the path to views, where the template for views_view_unformatted is located. After looking at the latest -dev it appears that there is just one location where this needs to be updated.
I have attached this new patch and it would be great if somebody could review it. I have tested this now on my multisite installation with great results on existing sites.
Please review!
Comment #9
dasginganinjaComment #10
Jeroen94 commentedThe problem persists in 7.x-1.3, but the patch in #9 seems to solve it!
Comment #11
joseph.olstadstill applies to 7.x-1.4 / 7.x-1.x dev
+1 thanks
Comment #13
minoroffense commented