TypeError, when geoPHP::load() returns bool

Created on 5 November 2024, 5 months ago

We're using Geofield on a site with lots of legacy user provided geolocation data.

Long story short, when I was running a task that was supposed to update and save a certain number of nodes, I got

TypeError: Cannot assign bool to property Drupal\geofield\Plugin\Field\FieldType\GeofieldItem::$geometry of type ?Geometry in Drupal\geofield\Plugin\Field\FieldType\GeofieldItem->isEmpty() (line 206 of /var/www/html/web/modules/contrib/geofield/src/Plugin/Field/FieldType/GeofieldItem.php).

Looking into it, depending on what input you feed it, geoPHP::load() can also return a boolean value, but since GeofieldItem expects the value to always be Geometry or NULL, this goes kaboom.

🐛 Bug report
Status

Active

Version

1.61

Component

Code

Created by

🇩🇪Germany marcoliver Neuss, NRW, Germany

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024