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!

Files: 
CommentFileSizeAuthor
#1 1462064.ol-views-empty-fields.patch1.53 KBkatbailey
PASSED: [[SimpleTest]]: [MySQL] 236 pass(es).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.53 KB
PASSED: [[SimpleTest]]: [MySQL] 236 pass(es).
[ View ]

Patch attached.

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

Status:Needs review» Reviewed & tested by the community

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

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.

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.

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?

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