Using a geofield lat/lon widget I try to preview a node before saving. It fails with these errors:

    Warning: fwrite() expects parameter 2 to be string, array given in geoPHP::detectFormat() (line 213 of /srv/work.electricgroups.com/dave/sunflower7/profiles/custom/modules/geophp/geoPHP/geoPHP.inc).
    Notice: Undefined index: in geoPHP::load() (line 62 of /srv/work.electricgroups.com/dave/sunflower7/profiles/custom/modules/geophp/geoPHP/geoPHP.inc).
    Exception: geoPHP could not find an adapter of type in geoPHP::load() (line 65 of /srv/work.electricgroups.com/dave/sunflower7/profiles/custom/modules/geophp/geoPHP/geoPHP.inc).

When saving, these errors don't appear and the node does save.

I'm using geoPHP 1.7 (although when I look at my drupal status report, it says, "GeoPHP 1.1 library installed at profiles/custom/modules/geophp/geoPHP/geoPHP.inc")

Comments

foopang’s picture

I have the same problem here.

interdruper’s picture

Status: Active » Reviewed & tested by the community

The source of this bug is Geofield module and how sometimes it loads GeoPHP classes, so IMHO it is not a GeoPHP module bug.

You may workaround the problem using last dev-version (7.x-2.0-alpha2+9-dev) of geofield.module file. Install the geofield 7.x-2.0-alpha2 version and overwrite just only the geofield.module file with its +9-dev version. This fixed the problem for me.

I found other problems when I installed the full 7.x-2.0-alpha2+9-dev version, it seems not stable yet, that's why I recommend you not to install the 7.x-2.0-alpha2+9-dev version, but to only upgrade geofield.module file to workaround this specific bug.

Ohoshi’s picture

Issue summary: View changes

still have this problem.
(with Geofield 7.x-2.1)

hvalentim’s picture

UPDATE: This seems to related with the use of GeoField PostGIS module (storing data in PostGIS tables). Default storage option seems not to suffer from this.

Likely the wrong place to report then. Will place it in Geofield.

GeoPHP library installed at sites/all/modules/geophp/geoPHP/geoPHP.inc
& GEOS PHP extension Installed
Geofield 7.x-2.1
geoPHP 7.x-1.7+3-dev

Using a geofield lat/lon widget it is Impossible to save node changes:

Warning: unpack() expects parameter 2 to be string, array given in geofield_field_load() (line 318 /public_html/sites/all/modules/geofield/geofield.module).
Notice: Undefined index: lat in geofield_field_formatter_view() (line 310 of /public_html/sites/all/modules/geofield/geofield.formatters.inc).
Notice: Undefined index: lon in geofield_field_formatter_view() (line 310 of /public_html/sites/all/modules/geofield/geofield.formatters.inc).

Watchdog:
Warning: fwrite() expects parameter 2 to be string, array given in geoPHP::detectFormat() (line 226 of /public_html/sites/all/modules/geophp/geoPHP/geoPHP.inc).

Dave Cohen’s picture

Status: Reviewed & tested by the community » Active

I encountered this with the default storage option. GeoField PostGIS not installed.

2pha’s picture

I have just encountered this error.
EDIT:
Turns out I had a geofield_gmap widget set, but that module had been turned off somehow. Turned the geofield_gmap module back on and error was gone.
So, it may be because the widget setting is wrong... maybe.

neslee canil pinto’s picture

Status: Active » Closed (outdated)