Steps to reproduce:

  1. Setup an OpenLayers Data Overlay
  2. Add a nid field and exclude it from visualization
  3. Add a (visible) math expression field using the nid field, e.g. [nid]+1
  4. Preview the display

Expected result: you get a diffferent computed value for each different node.
Actual result: you get the same value for each node, i.e. the expected value for the last row.

This has been discovered while trying to use a math expression field to select a single value among different location fields attached to different content types (i.e. emulating an OR among them) on the assumption that only one of them is actually populated for each row:

[field_location]+[field_location_2]+[field_location_4] (latitude field)
[field_location_1]+[field_location_3]+[field_location_5] (longitude field)

Every point in the map would end having the same position (the one of the last node).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Status: Active » Needs review
FileSize
1.09 KB

I initially rolled this against the 2.x branch but it applies cleanly on the 3.x branch too.

mgifford’s picture

I can confirm that this patch applies to the git repository.

zzolo’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Status: Needs review » Needs work

Hi @plach. This patch may have fixed this, can you confirm.
https://drupal.org/node/1462064

Note that 3.x is still way up in the air.

plach’s picture

Status: Needs work » Needs review

I tried with the lastest dev (03/25), which should include that fix with no luck. The patch still applies.

anniegreens’s picture

I can confirm that the patch from http://drupal.org/node/1462064 that is included in the latest dev does not fix this issue.

Patch from #1 re-rolled for latest dev.

anniegreens’s picture

Correctly named patch attached.

Pol’s picture

Thanks !

Committed to 7.x-2.x and 7.x-3.x.

Pol’s picture

Status: Needs review » Closed (fixed)