'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

beeradb’s picture

Status: Active » Closed (fixed)

i've merged this into the latest version.

Thanks,
Brad

summit’s picture

Version: 5.x-3.1-1 » 5.x-3.2-1
Status: Closed (fixed) » Active

Hi,

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

summit’s picture

Status: Active » Needs review

Hi,

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

ahoria’s picture

Version: 5.x-3.2-1 » 5.x-3.3

Hi,

I am still getting this error in version 3.3. Any updates on this fix?

Thanks.

Doha-Info.com’s picture

Getting 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.

renata-1’s picture

subscribing