with current dev versions of openlayers, views and ctools, i currently get the following error for each item in my map view:

Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1178 of /.../modules/views/handlers/views_handler_field.inc).

it worked fine before and i couldn't find any similar reports in the issue queues so far, can you reproduce this?

Comments

josebrito’s picture

Project: Openlayers » Views (for Drupal 7)
Version: 7.x-2.x-dev » 7.x-3.x-dev
Component: OpenLayers Views » Code

I have the same problem only with Views and Ctools.
According with the path seams an error on the views module on the views_handler_field.inc file with the code to reference the row index:

// Store the tokens for the row so we can reference them later if necessary.
$this->view->style_plugin->render_tokens[$this->view->row_index] = $tokens;

dawehner’s picture

Status: Active » Closed (duplicate)

The patch in #1111258: Allow underscores in CSS classes fixes this problem.

dasjo’s picture

Title: Fix current views integration » Undefined property: view notices
Status: Needs review » Active

still having problems with openlayers and views recently.
i have a basic openlayers configuration where i use separate float fields for latitude and longitude.

it works with version xxx of views, but i get the following warnings:

a list of

Notice: Undefined offset: 0 in views_handler_field_field->get_items() (line 663 of /.../modules/views/modules/field/views_handler_field_field.inc).

and

Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1198 of /..../modules/views/handlers/views_handler_field.inc).

i described some similar issues at http://drupal.org/node/1111258#comment-4316334 where dereine responds that openlayers would need to set the row_index properly in order to work.

upgraded my views dev version today, the maps don't work anymore and the errors change to

Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1208 of /.../modules/views/handlers/views_handler_field.inc).
Notice: Undefined index: entity_id_2 in openlayers_views_style_data->coalesce_wkt() (line 232 of /..../modules/openlayers/modules/openlayers_views/views/openlayers_views_style_data.inc).
Notice: Undefined index: entity_id_1 in openlayers_views_style_data->coalesce_wkt() (line 232 of /..../modules/openlayers/modules/openlayers_views/views/openlayers_views_style_data.inc).

looking forward to get openlayers to work with current views dev branch

dasjo’s picture

Title: Undefined property: view notices » Fix current views integration
Project: Views (for Drupal 7) » Openlayers
Version: 7.x-3.x-dev » 7.x-2.x-dev
Component: Code » OpenLayers Views
Status: Closed (duplicate) » Active
dasjo’s picture

debugging into function coalesce_wkt of openlayers_views_style_data<code> shows that <code>$features doesn't contain the necessary lat/lng fields.

tracked down the problem a little further and discovered, that when i save my openlayers view, all custom fields of the data overlay display are gone. adding the fields again won't help as they disappear as soon as i save the view. this seems to be the case for just any view i have setup. seems to be a known problem with views currently: #1126756: Views does not save new fields

dasjo’s picture

Title: Undefined property: view notices » Fix current views integration
Status: Active » Needs review
StatusFileSize
new665 bytes

avoid the problems with views fields by using views commit 3e51ad76b02ee90e06b7f798e8a28ca3e136fdb3.
this fixes the following two notices

Notice: Undefined index: entity_id_2 in openlayers_views_style_data->coalesce_wkt() (line 232 of /.../modules/openlayers/modules/openlayers_views/views/openlayers_views_style_data.inc).
Notice: Undefined index: entity_id_1 in openlayers_views_style_data->coalesce_wkt() (line 232 of /.../modules/openlayers/modules/openlayers_views/views/openlayers_views_style_data.inc).

eliminated the remaining views notice with the attached patch:

Notice: Undefined property: view::$row_index in views_handler_field->get_render_tokens() (line 1208 of /.../modules/views/handlers/views_handler_field.inc).

this essentially means, that views expects render_tokens and row_index to be set. the attached view patch adds a check if render_tokens exists.
i am not sure if this workaround is the way to go and we should push the patch to the views issue queue or if rather openlayers should set the values correctly

henrijs.seso’s picture

Status: Active » Needs review

#6 works but openlayers should definetly set the values correctly!

phayes’s picture

subscribing. I will take a look at this

phayes’s picture

Assigned: Unassigned » phayes
mr.baileys’s picture

Attached patch tackles the Undefined property: view::$row_index bug from the OP. I have not run into the other errors mentioned in this thread using up-to-date dev branches for CTools, Views and OpenLayers, so not sure whether or not those still need to be addressed.

henrijs.seso’s picture

Title: Fix current views integration » Fix current views integration - Undefined property: view::$row_index in views_handler_field->get_render_tokens() line 1178

#10 fixed issue for me. Because of cryptic title I did not notice this issue before and also found map_features to be a problem, thanks mr.baileys for saving an hour of my life.

dawehner’s picture

@mr baileys:

You need to add a field with a token and boom there will be a problem.

@mansspams
Thanks for the better issue title

mr.baileys’s picture

@dereine: can you elaborate? I'm using recent -dev versions with the patch from #10 applied, and there's no boom when using fields and tokens :)

dawehner’s picture

In general i just try to help on this issue, so i never saw this problem in real life.

But in general style plugins should the row index, because some features (for example the field global: result counter) rely on this.

Countzero’s picture

My bad : please discard this post.

zzolo’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

kurtzhong’s picture

Component: OpenLayers Views » OL API

Subscribe.