Reviewed & tested by the community
Project:
Geofield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2013 at 16:41 UTC
Updated:
20 Oct 2017 at 17:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dpw commented+1 making the field "required" in design view seems to require a default value to be added. I'm using the OpenLayers widget and Geofield 7.x-2.0-alpha2+7-dev (2013-Apr-06).
Comment #2
bechtold commented+1 using 7.x-2.0-alpha2+9-dev
If you enter a default value, the validation is ok, but the default value is not saved :-)
Comment #3
geodaniel commentedThis is an issue in 2.0 as well.
Comment #4
Breakerandi commentedAny news on this? I have the issue still with the latest 2.1 version!!!
Comment #5
tisteegz commentedI am also experiencing this issue and I can confirm that when I entered in default values the validation worked but the values weren't saved. Which is somewhat of an issue if anyone does want default values.
Comment #6
duaelfrHere are two independant patches that fixes both issues.
I updated the priority to Major because not being able to set a field as required without giving it a default value (which is never displayed again) prevents users to use the field as they need to.
Comment #7
gge commentedI had a problem where the default values were not displayed on add node form and after applying #6 patches everything works now. The patches couldn't be applied automatically using Netbeans but I applied them manually.
Thank you!
Comment #8
das-peter commentedI had a similar or basically the same issue in the new openlayers / geofield integration.
The way I handled this was using
'#limit_validation_errors'to completely disable the validation and the use$form_state['input']instead$form_state['values']to access the values for geocoding.Not sure of this works for all scenarios - but as for now it's part of openlayers ;)
Related openlayers commit: http://cgit.drupalcode.org/openlayers/commit/?id=a380422
Comment #9
gaëlgI can confirm that #6 fixes the bug. Thank you DuaelFr!
Comment #10
MissterX commentedGeofield version 7.x-2.3
#6, patch geofield-cannot_mark_field_as_required-1946058-6.patch
Confirmed as working.
Comment #11
brockfanning commentedAnother report that one of the patches in #6, geofield-cannot_mark_field_as_required-1946058-6.patch works to fix the bug that Geofields cannot be set as required.
I wonder if the fact that there are 2 patches here might be confusing the issue and delaying this getting committed. I would vote for committing geofield-cannot_mark_field_as_required-1946058-6.patch. After applying that patch, I don't see any problems with either setting a Geofield as required, or giving it a default value.
In fact, I'll take the liberty of hiding the extra patch, but feel free to reverse that if I'm missing something.