Problem/Motivation

When I use the "Distance" field on my results, I can choose to center by a Boundary filter, but I can't set the center from a Proximity filter. This means my Distance field is empty if I use a Proximity filter.

It looks like this was a regression caused by https://www.drupal.org/project/geolocation/issues/3562478. Because the Distance field passes context['views_field'], the change to the logic there means we don't have the option to centre using Proximity filters any more.

Steps to reproduce

1. Create a view with both a Boundary and a Proximity filter
2. Add the Distance field
3. Notice that you don't see the Proximity filter "Centre" option.

Example image:
A Distance field showing no Proximity filter

Proposed resolution

Basically, just copy the code in src/Plugin/geolocation/Location/ViewsBoundaryFilter.php:

&& $filter !== ($context['views_filter'] ?? NULL)

Remaining tasks

Supply MR

User interface changes

Boundary filter will show up as an option on the Proximity field:
A Distance field showing a Proximity filter

API changes

None

Data model changes

None

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mariacha1 created an issue. See original summary.

mariacha1’s picture

Title: Can't choose "Boundary" centering option for Distance field. » Can't choose "Proximity" centering option for Distance field.
Issue summary: View changes
StatusFileSize
new251.69 KB

christianadamski made their first commit to this issue’s fork.

christianadamski’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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