I'm getting these warnings and notices when displaying a view with an OL map

Notice: Undefined property: views_plugin_query_default::$fields in views_plugin_query_default->query() (line 1183 of /public_html/sites/default/modules/views/plugins/views_plugin_query_default.inc).
Warning: Invalid argument supplied for foreach() in views_plugin_query_default->compile_fields() (line 1101 of /public_html/sites/default/modules/views/plugins/views_plugin_query_default.inc).
Notice: Undefined property: views_plugin_query_default::$fields in views_plugin_query_default->query() (line 1183 of /public_html/sites/default/modules/views/plugins/views_plugin_query_default.inc).
Warning: Invalid argument supplied for foreach() in views_plugin_query_default->query() (line 1185 of /public_html/sites/default/modules/views/plugins/views_plugin_query_default.inc).
Warning: Invalid argument supplied for foreach() in views_plugin_query_default->compile_fields() (line 1101 of /public_html/sites/default/modules/views/plugins/views_plugin_query_default.inc).

Previous patch is already contained in the dev realease.
Thanks a lot for support.

Comments

sokrplare’s picture

Project: Views (for Drupal 7) » Openlayers

This happened for me when Sort Criteria was left empty. It might be a Views thing, but I'm wondering if it isn't OpenLayers' custom plugin expecting a Sort Criteria to exist. The fix is just add Post date back in - which I think is ignored since the data is being fed in from elsewhere, but having dug into the code yet so not sure exactly. Hopefully someone with more in-depth OpenLayers knowledge knows the answer to this and if it is actually a bug.

benjarlett’s picture

Ditto. I had the same experience as #1... and the same thing fixed it.

alexio2170’s picture

Actually it seems that the theme I was using was causing the warnings, changing the theme cleared the situation.
Hope this helps others.

axgalloway’s picture

Status: Active » Closed (duplicate)

A views issue, patch found here: http://drupal.org/node/1444272

coredumperror’s picture

Status: Closed (duplicate) » Active

The patch linked in #4 does not fix this problem. I tried that patch first, and it fixed some of the errors, but didn't actually fix the map. I was still getting other errors. Adding back the sort criteria was the only thing that worked.

m.stenta’s picture

Issue summary: View changes
Status: Active » Closed (fixed)

A lot of code has changed in Openlayers 7.x-3.x since this was posted, so there's a good chance this is either fixed, or no longer relevant. Please give the latest release a try (7.x-3.0) and reopen if you are still experiencing this issue. :-)