Needs review
Project:
Geofield
Version:
7.x-2.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 May 2013 at 10:17 UTC
Updated:
26 Feb 2016 at 20:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
GaborTorok commentedAdditionally openlayers_widget_geocode() uses #parents instead of #array_parents for retrieving elements from the form structure, but #parents defines the path in form_state['values'] and #array_parents defines the path in the form structure.
Comment #2
GaborTorok commentedThis patch solves the problems I described and now the geocoding works with my form that has the geofield deep in the form structure with #parents != #array_parents.
Comment #2.0
GaborTorok commentedMade the description more accurate
Comment #3
ryan.ryan commentedRerolling this patch against the latest stable version of geofield.
Comment #4
ryan.ryan commentedAdding the patch :)
Comment #5
solotandem commented@ryanissamson, I came up with essentially the same patch (before finding this issue..lol), but did not include the statements that set
$field_value[LANGUAGE_NONE]instead of$field_value[$langcode]only to be followed up with this:Is there some reason you suggest these extra statements?
Otherwise, the patch is RTBC.
Comment #6
solotandem commentedAttached patch removes the extraneous statements from previous patch.
Comment #7
jasonawantHi,
The additional step sets the field value using the form elements language key, in case the field has been translated. I've removed this line
$field_value[$langcode] = $field_value[LANGUAGE_NONE];, which unsets the returned value when using this on the node add form. At this point, the form element language is undefined.Despite lines 305 and 306 in geocoder.widget.inc, the field can be translated.
New patch attached. Jason