We did something stupid or so but we don't know what it was.The result is that at one of our content types we get the following errors:

* warning: Invalid argument supplied for foreach() in /var/www/drupal.akademie.de/htdocs/sites/all/modules/views/views_query.inc on line 83.
* warning: Invalid argument supplied for foreach() in /var/www/drupal.akademie.de/htdocs/sites/all/modules/views/views_query.inc on line 16.
* warning: Invalid argument supplied for foreach() in /var/www/drupal.akademie.de/htdocs/sites/all/modules/views/views_query.inc on line 197.

If I print_r all views, at this content type I get the following view (in addition to the working ones):

stdClass Object
(
    [build_type] => items
    [type] => 
    [use_pager] => 
    [pager_limit] => 0
    [current_page] => 0
    [offset] => 0
    [used_filters] => Array
        (
        )

)

Has anyone got an idea what went wrong and where to look to fix this? Thanks for any help.

Comments

nath’s picture

using the devel module, I could find out, that the problem is with _views_load_view in the query SELECT v.* FROM view_view v WHERE v.name = 'autor'. The view autor has been deleted, so that explains why there are errors when trying to load that view.

What I do not know though is why that view is being loaded at all.
Can anyone point me in the right direction?

JuliaKM’s picture

If you haven't already, you should clear the Views cache on your site. You can find the button to "Clear views cache" at:

http://www.mysite.com/admin/build/views/tools

nath’s picture

I did try that, thanks. It didn't help though.
I now have created a completely empty view that is called "autor". That results in at least the error messages to be gone.

I still have no idea where to look for the real solution though.

merlinofchaos’s picture

You probably have something loading the code manually. You should do a debug backtrace, figure out exactly where the code is that's loading the view, and then start examining the data.

nath’s picture

Status: Active » Fixed

Found it: Some custom pager that everyone had forgotten was using that view. Now, all is fine again. :)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.