It looks like all previous default values are kept in the field settings.
If we change from lat/lon (or bounds) to wkt (or json) then $items[$delta]['geom'] will not be empty.
In fact, it will contain an array of coordinates (lat, lon and/or top, right, bottom, left).
As soon as we try and edit the field after the change we have a critical exception:
Warning: fwrite() expects parameter 2 to be string, array given in geoPHP::detectFormat() (line 213 of [...]/sites/all/modules/geophp/geoPHP/geoPHP.inc).
Notice: Undefined index: in geoPHP::load() (line 62 of [...]/sites/all/modules/geophp/geoPHP/geoPHP.inc).
Exception: geoPHP could not find an adapter of type in geoPHP::load() (line 65 of [...]/sites/all/modules/geophp/geoPHP/geoPHP.inc).
Comment | File | Size | Author |
---|---|---|---|
#6 | geofield-instance_recursion-1840920-6.patch | 687 bytes | plach |
Comments
Comment #1
tito.brasolin CreditAttribution: tito.brasolin commentedMaybe hook_field_update_instance can be used to empty the default value after the widget type has changed?
Comment #2
phayes CreditAttribution: phayes commentedupgrading this to critical. This is pretty bad.
Comment #3
Brandonian CreditAttribution: Brandonian commented@tito.brasolin, good call on hook_field_update_instance. I've committed a fix to deal with this issue. Any time the widget is changed, we clear out the default values.
http://drupalcode.org/project/geofield.git/commit/6b59c3e
Comment #4
Mac_Weber CreditAttribution: Mac_Weber commentedI'm getting the same error of line 65. Not sure if I should open a new issue, because I'm actually getting it running
drush sorl-index
:Comment #5
Mac_Weber CreditAttribution: Mac_Weber commentedWell, I changed the widget to a different one and back to the old one. Everything is working fine now with drush.
I think it was because I had the 7.x-1.1 version installed before
Comment #6
plachSmall followup: I got infinite recursion while enabling Commerce Coupon Percentage, which triggers an update of field instances and does not populate the
$instance['widget']['type']['key']
. The attached patch fixes it and avoids any possibilty of recursions by not invoking the update hook and doing a straight field instance save.Comment #7
Brandonian CreditAttribution: Brandonian commentedThanks for the followup patch, @plach! Committed to 7.x-2.x
http://drupalcode.org/project/geofield.git/commit/17052f3
Comment #9
Ohoshi CreditAttribution: Ohoshi commentedI installed the latest version(Geofield 7.x-2.1) and encounter this problem.
Really need help, thanks!!