Jump to:

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.

Comments

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

I'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.

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

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

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.

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. module mymodule provides a template for views-view--viewname--displayid, and maybe theme timi overrides it. Then shouldn’t the theme key in mymodule_theme($existing) be

then the views-view--viewname--displayid.tpl.php (File not found, in folder ./) error disappears, but when I preview the view, I get errors:

warning: include(./sites/all/modules/mymodule/themes/sites/all/modules/mymodule/themes/views-view--viewname--displayid.tpl.php) [function.include]: failed to open stream: No such file or directory in /***/includes/theme.inc on line 1066.

Ok, 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.