Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have downloaded Views 6.x-2.2 and was starting to create my first view. I set the format to be HTML list and then when I click on Theme:Information I get the error views-view-list.tpl.php (File not found, in folder ./). I checked the directory that views-view.tpl.php and views-view-fields.tpl.php are in to make sure it was there as they came up bold as they should have. The file is there, but it is not finding it. I also tried copying the file and placing it inside my theme and then rescaned the template folders with no luck. Does any one have any ideas. Thanks in advance.
Comment | File | Size | Author |
---|---|---|---|
#4 | view-export.txt | 4.19 KB | aangel |
Comments
Comment #1
SnowB1 CreditAttribution: SnowB1 commentedI am also getting the error - An error occurred at /admin/build/views/ajax/preview/news_archive. I found a post that said you just need to change your data value in the table views_object_cache to the longblob type. I have done this, deleted the view and started over and get the same error. Any help would again be appreciated.
Comment #2
dawehnerCan you try to reproduce it with the latest views version?
Comment #3
Aniara.io CreditAttribution: Aniara.io commentedI'm getting these warning messages when accessing the Theme Information for any view on 2.7 that has a page display with a path under /admin/xxx, all default templates are marked in red and can't seem to be overridden by any matching template. For other views I'm not getting any of these warnings.
Comment #4
aangel CreditAttribution: aangel commentedI'm getting the error:
"views-view.tpl.php (File not found, in folder sites/all/modules/contributed/date/)"
Exported view attached, in case that helps.
This is with drupal 6.14, cck 2.6, views 2.7
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedThat looks like a date.module bug
Comment #6
aangel CreditAttribution: aangel commentedPerhaps, or in the interface between the two modules.
Either way it's a showstopper for me. The template that's being returned is:
sites/all/modules/contributed/date/views-view.tpl.php
which, unfortunately, doesn't exist.
Comment #7
aangel CreditAttribution: aangel commentedI tried to get to the bottom of the error but my debugger is throwing an exception on an include ("can't redeclare xxxx") so I am forced to go for the workaround.
What I think I saw happening was views_views['path'] in the theme registry was being filled with sites/all/modules/contributed/date. I couldn't narrow down if it was being set initially that way or whether it was being overwritten later (presumably by the date module). I suspect the later since disabling the date module gives a perfectly fine theme registry entry (i.e. path points to the views module directory).
Creating a views-view--myviewname.tpl.php got me around this problem, though. I don't use it but for now it needs to be there.
Comment #8
luthien CreditAttribution: luthien commentedclearing cache fixed the error I got after creating views-view--myviewname.tpl.php within my theme.
Comment #9
JeremyFrench CreditAttribution: JeremyFrench commentedI am not quite sure where the error lies, but I had a similar error when trying to add a hook_theme function to add templates to my view from the documentation here http://views-help.doc.logrus.com/help/views/api-default-views
I had to add a line
to the array for it to find the template.
I don't know if this is an issue with views, the templating system or the documentation.
Comment #10
Yas375 CreditAttribution: Yas375 commentedI had the same problem when I using my custom theme on drupal 6.16 and views 6.x.2.8 (i'm not using date module).
If i change in scan options in views theme to garland I see, that all is ok. Then I look to my template.php in my custom theme and found there next mistake:
I create my custom theme from zen, but alone, without zen, but with some code snippets from here. I remove this function because i dont't defined here $hooks but using this. After this all become ok.
Totally: if you have the same error, then first thing what you should done is clear your template.php
---
best regards,
Victor Ilyukevich, aKa yas
Comment #11
esmerel CreditAttribution: esmerel commentedOk, there's been a couple of new versions of views since this. Is it still a problem?
Comment #12
Yuri CreditAttribution: Yuri commentedIn my case (views 6.x-2.11) this error message appeared also. When I looked at the filename that was mentioned in the error message, it appeared that views automatically replaced the underscores in my views template file name by minus signs. Renaming the view 'resolved' this.
Comment #13
merlinofchaos CreditAttribution: merlinofchaos commentedThe theme system does this; _ are automatically translated to -.
Comment #14
esmerel CreditAttribution: esmerel commentedComment #16
Gastonia CreditAttribution: Gastonia commentedAlbeit a bit late, I know why this is happening.
I first tried to theme views output by using the candidate theme function in my template.php file. I wasn't getting the result I wanted, so I then tried to create a template file of the same name to modify the raw data before it was stored in the $output variable.
Because I did not remove the function from my template.php file, the views module would not see that I had a correctly named .tpl.php file.
In other words, if you're getting this error, make sure you don't have a function in the template.php file of the same name as the template (.tpl.php) file.
Blue
http://gastonia.com
Comment #17
Ölbaum CreditAttribution: Ölbaum commentedYes, it is still a problem.
Comment #18
Ölbaum CreditAttribution: Ölbaum commentedMore info:
The “advanced” help says:
yet
function format_themes($themes)
inplugins/views_plugin_display.inc
does not use thetemplate
key whatsoever:Also, unless there is a key for
views_view__viewname__displayid
in the theme registry, Views only searches for templates in the Drupal root (where they will never be):$template_path = isset($registry[$theme]['path']) ? $registry[$theme]['path'] . '/' : './';
I am new to the Drupal theme registry, but this doesn’t look to make any sense.
function format_themes($themes)
is looping over themes, doesn’t it mean that it looks at what components (modules, themes) provide templates for the current view element? I.e. modulemymodule
provides a template forviews-view--viewname--displayid
, and maybe themetimi
overrides it. Then shouldn’t the theme key inmymodule_theme($existing)
beand the
template
actually be used to specify the template provided?Finally, if I add an entry to the theme registry so that
function format_themes($themes)
finds my template:then the views-view--viewname--displayid.tpl.php (File not found, in folder ./) error disappears, but when I preview the view, I get errors:
So there are definitely several things that go wrong here.
Comment #19
merlinofchaos CreditAttribution: merlinofchaos commentedOk, certainly it looks like using $registry[$theme]['template'] would be an improvement, if it's available. It certainly seems like it should be.
As for the 'path' thing you're showing, somehow the path is getting added to the default path. I don't immediately see how that can happen. You can look into theme.inc and look for $template_file and $render_function and see what's actually going on there, I guess, but you're in core code. Even though I wrote that code, it's been several years now.
I do know that when using the alter function, things are very fragile at that point since it's already done all the discovery it's going to do, and everything has to be exact already because it believes everything is as it should be.
Comment #20
held69 CreditAttribution: held69 commentedGetting the (File not found, in folder ./), error as well.
Using views 6.x-2.11
Trying to add a variable.
However couldn't prevent the advice of comment#16
Is there an alternative for this to prevent (file not found) error?
Comment #21
sushantpasteTry this to avoid (File not found, in folder ./) error.
Hth
Comment #22
blakefrederick CreditAttribution: blakefrederick commentedFor me the issue was the devel module. After I disabled it, the template files were found again.
I found this solution in a newer Drupal thread about Views 7.x-3.7: https://drupal.org/node/2042937
This may be helpful for solving the issue with Views 6.x-2.7.
Comment #23
theplanets CreditAttribution: theplanets commentedSolution for me was #22 as well. That Devel module has gotten buggy since drupal 6.
Comment #24
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue