I use the Geofield module to store location information with a node and display the nodes on a map using the Openlayers module. When the map is displayed the following notice is thrown twice for each node:

Notice: Undefined index: format in geofield_field_formatter_view() (line 71 of /var/www/.../htdocs/sites/default/modules/contrib/geofield/geofield.formatters.inc).

I use the Openlayers map widget and the node information comes from a view that outputs the Geofield value using the WKT Formatter and Full geometry data option.

The error is in the following line:

if ($display['settings']['format'] == 'degrees_minutes_seconds') {

Apparantly the format index is not always set so you either have to always set it or first check if the index exists before checking the value?

Comments

marty2081’s picture

Oh, and there is a typo on line 139:

'decimal_degrees' => t('Decimal degress'),

phayes’s picture

Status: Active » Needs review
marty2081’s picture

Hi Patrick,

Thanks for the fast reply. The notices and typo are corrected.

I do get a new Notice now, but I'll open a new issue for that.

phayes’s picture

Status: Needs review » Fixed

Thanks

avdp’s picture

Small typo in code:
if (isset($dispay['settings']['format'])) {

) at the end

Status: Fixed » Closed (fixed)
Issue tags: -notice

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