My second error in 2 days with location / gmap.
At least I patched the other one :]
Ok, I attempted to mass import information into my system.
I tried:
Database scripting. Worked well to display the maps.
Database scripting with Node_Load and Node_Save. Worked Well to display the maps.
BUT as you can see from the picture... my fields don't populate, and if I edit this form it only creates a NEW node. That is unacceptable for production. I am hoping some one has the solution, and if not I will have to circle back to it later.
Check out the screen shot. Map data is clearly working ... but the data that makes it does not show up in the form fields.
Comments
Comment #1
notsoluckycharm commentedSo, here is the culprit.
0.621location_load_location
SELECT * FROM Main_location WHERE lid = 0
0.441location_fax_locationapi
SELECT fax FROM Main_location_fax WHERE lid = 0
0.471location_phone_locationapi
SELECT phone FROM Main_location_phone WHERE lid = 0
Courtesy of the Devel module.
I need to figure out who called this and gave it the value of 0... and I mean, after all... this damn thing is the 3rd time it's called. This one is recursive for multiple values and it populates the form.
The only place I can find that function doesn't respond to echos or anything.
Any ideas?
Comment #2
notsoluckycharm commentedI found the culprit... and I have no idea why it's like this...
I have to tell you, once you make any changes to the database, this code completely messes everything up.
Say you increment all your LIDs by one? Or rego with a script over the database? Everything is completely screwed.
I am going to say this now: I am removing this line of code, and thus far it runs better. No side effects.
My next task ? Merging the redundant location[] and locations[] arrays.
If anyone actually reads my posts let me know... because I have fixed two things wrong about locations xD
Comment #3
notsoluckycharm commentedTurns out it was a bit more complex. This function is only retrieving bad data seeded by another function that caches the CCK information.
Clearing th caches and dumping location_cck_field switch op load reveals that &$items is blank.
Got to find out why it's being passed in to the function blank.
Comment #4
notsoluckycharm commentedGot it.
If you don't submit a node through the form, all your fancy functions don't get saved and $element['default_value'] never gets populated.
Need to figure out how to do that in a programmatic fashion, or by hand... ha..
Comment #5
yesct commentedI'm reading, but not sure I understand exactly.
Comment #6
ankur commentedThis sounds more like an issue with the import script.