Closed (fixed)
Project:
Geofield
Version:
8.x-1.2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2019 at 17:15 UTC
Updated:
8 May 2019 at 11:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
adamps commentedComment #3
itamair commentedRight @AdamPS ... but your patch is right only when the proximity filter is not exposed.
In case of exposed Geofield Proximity Filter, an empty Origin shouldn't affect the final result, for what discussed here: https://www.drupal.org/project/geofield/issues/3012750#comment-12857795.
A consequently tuned (and new) patch attached.
Comment #5
itamair commentedLast commit includes the #3, and additionally includes better validation on empty and not valid origin, and corrects validation on required origin on exposed proximity filter.
Comment #6
itamair commentedComment #7
adamps commentedGreat, thanks
Comment #8
Anonymous (not verified) commentedSince this commit in version 1.2, notices are thrown on a view:
Notice: Undefined index: origin in Drupal\geofield\Plugin\views\filter\GeofieldProximityFilter->validateExposed() (line 305 of modules/contrib/geofield/src/Plugin/views/filter/GeofieldProximityFilter.php).The filtering works ok though.
Comment #9
itamair commentedYes you are right. My fault. I missed to handle the case of address (geolocated) origin.
New patch attached upon the 8.x-1.2 version .... going to commit.
Comment #11
Anonymous (not verified) commentedGreat, thank you.
Works nicely.
Comment #13
adamps commentedOK so it's still not working. I have a view with an exposed filter. It's the completely standard and obvious map search: users type in a town or zip/postal code and they get results nearby.
If I type in "lodnon" then I get a random list of results from anywhere in the country. Surely this is not what any user wants or how any other site works?? If the geocode of the origin fails then I expect to see an error "no results found".
So you are referring to my comment:-) I'm not sure which of the numbered points you mean - perhaps the closest is 3.
However #3 is referring to the distance. It's completely different: leaving distance empty naturally has the meaning "unlimited distance". Leaving the origin empty does not naturally have the meaning "random results from anywhere".
I think if you check any other sites on the internet or get users to do usability testing it will confirm this. I don't have permission to re-open this issue so have created #3053372: Proximity filter must handle geocode failures.