I just looked through the issue queue to see if anyone else had come across this as it's quite a serious problem - the only similar issue I came across was this one #1173988: View with empty wtk fields -> wrong map rendering but zzolo responded there saying he believed the issue had been fixed in dev and the OP never responded. I'm working with the latest Views code and the latest OL (2.x) code and the problem is still there. What happens is that the map_features function in the openlayers_views_style_data class iterates over the records and assigns field values as feature attributes, but it does this by accessing the original_value property of the field handler. If a particular record does not have a value at all for that field, it is getting the value from the previous record that did have one.

Patch forthcoming!

CommentFileSizeAuthor
#1 1462064.ol-views-empty-fields.patch1.53 KBkatbailey
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

katbailey’s picture

Status: Active » Needs review
FileSize
1.53 KB

Patch attached.

mgifford’s picture

Patch applies against the latest dev version

$ cd /DRUPAL7/sites/all/modules/openlayers/modules/openlayers_views
$ patch views/openlayers_views_style_data.inc < 1462064.ol-views-empty-fields.patch
patching file views/openlayers_views_style_data.inc
Hunk #1 succeeded at 253 with fuzz 1 (offset -37 lines).

sreynen’s picture

Status: Needs review » Reviewed & tested by the community

This solved the problem for me and did not appear to create any new problems.

zzolo’s picture

Status: Reviewed & tested by the community » Fixed

Thanks very much, @katbailey. Committed:
http://drupalcode.org/project/openlayers.git/commit/58ad68b

Status: Fixed » Closed (fixed)

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

anniegreens’s picture

Status: Closed (fixed) » Active

I am still seeing this issue in the latest dev release, even though I can verify the new code exists.

I have phone numbers being excluded and included in a subsequent address field rewrite to be shown in the 'description' of the popup; all end up having the same phone number.

I arrived here from this issue http://drupal.org/node/1377500 that specifically refers to excluded fields, so these may be two separate issues.

rterman’s picture

I am having the same problem. I have body and an excluded link field, and replaced the body field with "[body]
[link}." Then I assigned the open layers "description" field to the body field and am seeing all nodes with the same link field (the link is associated with the first node rendered.

Any fix for this please?

rterman’s picture

Update: I made the problematic field to display (i.e. unchecked the "exclude from display") and it worked!

  • zzolo committed 58ad68b on 7.x-3.1.x authored by katbailey
    Issue #1462064 by katbailey: Ensure field value in views.