Needs review
Project:
cck_map
Version:
5.x-3.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2007 at 05:45 UTC
Updated:
10 Jun 2008 at 13:06 UTC
'load' op of cck_map_field gives a warning if there is no data to load. Here's how I suppressed it, but just a suggestion of course.
case 'load':
if ($node->nid) {
$map_info = db_fetch_array(db_query("SELECT maplat, maplon, mapzoom, maptype from {cck_map} WHERE nid = %d and vid = %d", $node->nid, $node->vid));
if (is_array($map_info)) {
return array($field['field_name'] => array_merge($node->$field['field_name'], $map_info));
}
}
Comments
Comment #1
beeradb commentedi've merged this into the latest version.
Thanks,
Brad
Comment #2
summit commentedHi,
It looks like this error is still there, or another error arose because of this patch?
May be I am wrong off course..my bugissue here: http://drupal.org/node/204264 I think they are related because the line of change is the same..line 264..
thanks in advance for your reply,
greetings,
Martijn
Comment #3
summit commentedHi,
I altered the code as follows (I made an array of the first argument):
line 264: return array($field['field_name'] => array_merge(array($node->$field['field_name']), $map_info));
I am not getting the warning anymore, is this a correct change?
greetings,
Martijn
Comment #4
ahoria commentedHi,
I am still getting this error in version 3.3. Any updates on this fix?
Thanks.
Comment #5
Doha-Info.com commentedGetting this error as well. CCK Map field set to optional, but if no marker placed it returns error:
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/dohainfo/public_html/sites/all/modules/cck_map/cck_map.module on line 260.
Comment #6
renata-1 commentedsubscribing