Problem/Motivation

After updating the geofield module from 1.22.0 to 1.32.0 I'm getting the following notice. I'm on drupal core 8.9.16.

Notice: Undefined index: lat in Drupal\geofield\Plugin\GeofieldProximitySourceBase->getHaversineOptions()

Steps to reproduce

On my site this notice is appearing wherever geofield is being used.

Comments

jor_kai created an issue. See original summary.

itamair’s picture

Category: Support request » Bug report
Status: Active » Fixed
StatusFileSize
new925 bytes

Thanks for reporting this @jor_kai.
Does the attached patch solve your issue?
Please test and deep review ....

itamair’s picture

Status: Fixed » Needs review

  • itamair committed c43bed1 on 8.x-1.x
    Issue #3223984 by itamair: Notice: Undefined index: lat in Drupal\...
itamair’s picture

Status: Needs review » Fixed

Committed into dev, will be part of the next Geofield release.

jor_kai’s picture

Hi itamair, thanks for you work on this module and your quick response. Also apologies for my delayed response. I've applied you patch and am no longer receiving the notice.

jor_kai’s picture

I've noticed an issue after applying the patch. I'm now getting a drupal system message that says "An illegal choice has been detected. Contact the site administrator".

When I check status logs I see the following error.

Drupal\geofield\Exception\HaversineUnavailableException: Not able to calculate Haversine Options due to invalid Proximity origin location. in Drupal\geofield\Plugin\GeofieldProximitySourceBase->getHaversineOptions() (line 176 of /var/www/html/projects/websites/memorialcare.org/www-jordan/modules/contrib/geofield/src/Plugin/GeofieldProximitySourceBase.php).

jor_kai’s picture

Status: Fixed » Needs work

Setting the status back to "Needs Work". I think that is the correct status because of my issue above.

jor_kai’s picture

Status: Needs work » Fixed

Sorry for the back and forth. Looking at this closer the issues I reported above appear to be coming from my own code. Setting the status back to fixed.

  • itamair committed 729ad95 on 8.x-1.x
    Issue #3223984 by itamair: Notice: Undefined index: lat in Drupal\...

  • itamair committed 6d2babf on 8.x-1.x
    Issue #3223984 by itamair: Notice: Undefined index: lat in Drupal\...
itamair’s picture

Thanks @jor_kai ... but we still have an issue here.
The Drupal\geofield\Exception\HaversineUnavailableException shouldn't be thrown for an invalid Origin Lat/Lon pair definition.
The last commit fixes better all this and I am going to deploy a new 8.x-1.34 release.

jor_kai’s picture

Thanks @itamair, I've updated to 8.x-1.34 and everything is working great for me.

Status: Fixed » Closed (fixed)

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