Trying to add a new Geofield to an entity results in a PHP fatal error:

PHP Fatal error:  Call to a member function out() on a non-object in .../openlayers/modules/openlayers_geofield/src/Plugin/Component/GeofieldWidget/GeofieldWidget.php on line 240

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Status: Active » Needs review
StatusFileSize
new1.06 KB

The problem is that the code at line 240 assumes that $geom['geom'] is a valid geometry object returned by $geom = geoPHP::geometryReduce($geoms); (line 151 of the same file). This is not always true.

So my fix just checks to see if $geom['geom'] is not empty before trying to extract WKT from it.

  • Pol committed b158ffa on 7.x-3.x authored by m.stenta
    Issue #2626706 by m.stenta: PHP fatal error in Geofield widget settings...
pol’s picture

Status: Needs review » Fixed

Thanks !!

Status: Fixed » Closed (fixed)

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