CommonMap show all entity values regardless of row data

Created on 25 February 2022, almost 3 years ago
Updated 16 May 2024, 8 months ago

Problem/Motivation

When using Geolocation CommonMap format in Views, if the Geolocation field is multi-value the map shows all values from the entity, no matter whether the field and filters are configured to show less per row, for example, if we want to show in the map just the first value (delta = 0).

Steps to reproduce

  1. Create a Geolocation field on a node with unlimited values.
  2. Create nodes with multiple values for that field
  3. Create a view with Geolocation CommonMap as format, displaying that Geolocation field
  4. Check the map is showing all values
  5. Create a geolocation field delta filter where the value must be equal to 0, so it displays just the first value for each node
  6. Check the map still shows all values of the node or nodes, instead of just the first one

Proposed resolution

DataProviderBase::getPositionsFromViewsRow() does not honor its own name because it does not take the positions from the Views Row, but instead it takes the entity from the row (within DataProviderBase::getFieldItemsFromViewsRow()) and get all positions from the entity field regardless of the views row data.

That might make sense when we want to group all values in the same row (checking that option in the field settings), but not when we want each value in a different row, and maybe filter those results as in the proposed scenario.

We should take the position from the row data if it's available, and show all the entity values only when the option of grouping all values in the row has been set.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Geolocation Field / Backend

Created by

πŸ‡ͺπŸ‡ΈSpain juanolalla

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024