Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using the Openlayers formatter on a Geofield (provided by the openlayers_geofield module), the field label is shown on a rendered entity even when the geofield value is empty.
So for instance, I have a Geofield titled "Geometry". When that field is left blank, and the entity is saved, the word "Geometry:" still appears in the rendered entity, with nothing else (no map).
Comment | File | Size | Author |
---|---|---|---|
#2 | openlayers_geofield_empty_label-2880034-1.patch | 564 bytes | m.stenta |
Comments
Comment #2
m.stentaHere is a very simple patch to the openlayers_geofield field formatter function (
openlayers_geofield_field_formatter_view()
) which detects if there are no values, and returns an empty element, instead of continuing to build the field output.Comment #3
PolHi there,
Seems good for me :)
Comment #5
m.stentaThanks for reviewing @Pol! I committed this.