warning: array_merge_recursive() [function.array-merge-recursive]:

Scott Falconer - April 29, 2007 - 20:32
Project:GMap Module
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

I'm getting a "warning: array_merge_recursive() [function.array-merge-recursive]: Argument #1 is not an array in /home/public_html/includes/common.inc on line 1667." message using the newest gmap 5.x-1.dev release. Gmap worked find before this version. We're running in php 5. Any ideas?

#1

poolplayr - April 30, 2007 - 13:16

Same problem as well!

#2

fm - April 30, 2007 - 16:35

me too!

#3

webchick - May 1, 2007 - 17:16

Same. I've narrowed it down to the following line:

<?php
drupal_add_js
(drupal_to_js(array('gmap_markermanager'=>$mms[$mm])),'setting');
?>

If you comment that out, it works, but I assume that line is necessary for something. ;)

#4

webchick - May 1, 2007 - 17:24
Status:active» patch (code needs review)

I *think* this fixes it?

AttachmentSize
gmap_1.patch876 bytes

#5

bdragon - May 1, 2007 - 17:30

DOH! I see what we're getting at here.

OK, the problem was that there are no options for the unmanaged case. For some reason, my site doesn't complain about this and just sends NULL.

So, I should do an empty() check and use array() instead in this case... That should work.

#6

bdragon - May 1, 2007 - 17:47
Status:patch (code needs review)» active (needs more info)

OK, committed a workaround to use array() for a case where there are no settings.
Also fixed a bug that was causing location chooser to not work, but that's another bug.

Please test the next snapshot.

Thanks!

#7

webchick - May 2, 2007 - 16:17
Status:active (needs more info)» patch (code needs review)

That did fix the error on my install, however now there is another error when you very first go to the GMap settings page (to reproduce, click the "Reset to defaults" button):

warning: Cannot use a scalar value as an array in /Applications/MAMP/htdocs/bigmindgroups/public_html/sites/groups/modules/drupal-contrib/gmap/gmap.module on line 133.

As soon as you save the form, it goes away.

This seems to fix it.

AttachmentSize
gmap_2.patch657 bytes

#8

bdragon - May 2, 2007 - 16:53
Status:patch (code needs review)» active (needs more info)

OK. Committed.

#9

webchick - May 2, 2007 - 17:23
Status:active (needs more info)» fixed

Works for me!

#10

Anonymous - May 16, 2007 - 17:34
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.