Closed (duplicate)
Project:
Geofield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jan 2013 at 12:03 UTC
Updated:
14 Oct 2013 at 17:45 UTC
I am getting this error :
i have entity reference field in my node create form and using entity connect module to create a new entity from the node create form the new node form opens in the same page , we will be redirected to the original node create form when we return to node after creating the referenced entity we get this error
we also have the geofield in the same form
Notice: Undefined index: default_value in geofield_field_presave() (line 280 of C:\wamp\www\xxxxxx\sites\all\modules\geofield\geofield.module).
Warning: Invalid argument supplied for foreach() in geofield_field_presave() (line 290 of C:\wamp\www\xxxxx\sites\all\modules\geofield\geofield.module).
Comments
Comment #1
boabjohn commentedWe do not use the entity connect module and just started getting the same error today.
Our site is basic D7, everything up to date or in dev if required. Geofield is storing wkt spatial data after geocoding a addressfield.
We did not have this issue 4 days ago: now a non-U1 user is getting it.
Wondering about field permissions and that sort of thing given the circumstances.
@kaizerking: any clues? How did you go sorting it out, or are you still looking for some more assistance?
Comment #2
kaizerking commented@boabjohn ,No solution so far
Comment #3
boabjohn commentedI can confirm that this error is still ocurring even though we have shifted platforms (Ubuntu to Debian).
In a node type with a address_field which feeds the geofield, on node creation the error is returned:
So this is on line 290 (not 280), and is related to an invalid argument (not undefined index). But it seems to be happening in a similar stage of processing.
This only happens on node create: it does not appear on node edit or delete.
Any thoughts out there?
Comment #4
greenskunkHave you tried the latest geoPHP library? See http://drupal.org/node/1881056
Good luck
Comment #5
mikhailian commentedHello,
I can confirm getting
with geofield-7.x-2.0-alpha2+6-dev and geophp-7.x-1.1.
Comment #6
retiredpro commentedI am also getting this message. using geofield 7.x-2.x-dev (2013-Jan-13), geophp 7.x-1.7, and geophp library 1.1 from the link above
Warning: Invalid argument supplied for foreach() in geofield_field_presave() (line 290 of /var/www/testsite.com/htdocs/sites/all/modules/geofield/geofield.module).
Comment #7
greenskunkBe sure to apply @phayes patch, from 2013-01-25, at http://drupal.org/node/1862922#comment-6980730
Comment #8
retiredpro commentedPatch didnt fix it for me.
Comment #9
Ovation1357 commentedI hit this exact same issue when using this field in a user profile. Having looked into it I'm fairly sure I understand why I'm seeing it:
1) When 'Widget Type' is set to 'Geocode from another field', there is no option to set a default value for the field.
2) I had made the field optional.
We can see above that if the field is not marked as required and $items is empty it tries to set $items using the Default Value. But there is no default value!!
For me, making the field Required bypasses this problem .
When using 'Geocode from another field', setting required does not actually show the GeoField field on the creation form and it's automatically handled in the background.
Hope this helps someone.
Comment #10
JSCSJSCS commentedThanks Ovation1357. Setting the geofield to required fixed it for me too. This should probably be fixed to not require that though.
Comment #11
kingfisher64 commentedI had two instances of this error both fixed with #9 suggestion by Ovation1357 - thanks.
Comment #12
gamesfrager commented+1 setting the filed to required fixed it for me as well.
Comment #13
kingfisher64 commentedSince having to set the field to required isn't really a proper fix, but does work, how would this best be handled?
Comment #14
deanflory commentedI too am having the same errors occur. Just posting here to keep the issue current as all of my modules are up-to-date, applying the patch mentioned in #7 along with updating the geoPHP library, will see if I have the same problems afterwards.
Comment #15
mac_weber commentedThere is a duplicate issue #1886852: Geofield: Empty values on widgets with default values skip validation
Which one shall we close? This problem started after the other issue.
Comment #16
gamesfrager commentedI vote for closing the other one as the title of this issue is the exact error that people get, and most likely is what people will be using in their search.
Comment #17
jpstrikesback commented#1886852: Geofield: Empty values on widgets with default values skip validation contains a fix so I wouldn't close it :) see my comment in #9
Comment #18
Brandonian commentedMarking this as a duplicate of #1886852: Geofield: Empty values on widgets with default values skip validation
Comment #19
leoklein commented#9 worked for me. Thanks!
Comment #20
zilla commented#9 works still (october) with latest geofield