* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /media/wd500/www/devroots/d6-matadortravel-com/sites/all/modules/location/location.module on line 1409.
Error appears twice when viewing a user's page, with content profile, APK installed on drupal 6.9
This is the referenced code...
**
* Returns an empty location object based on the given settings.
*/
function location_empty_location($settings) {
$defaults = location_invoke_locationapi($location, 'defaults');
if (isset($settings['form']['fields'])) {
foreach ($settings['form']['fields'] as $k => $v) {
$defaults[$k] = array_merge($defaults[$k], $v); //line 1409
}
}
...
So it looks like location_invoke_locationapi is screwing up, giving a non array (or nothing at all)...
Comments
Comment #1
orces commentedSame problem
warning: array_merge() [function.array-merge]: Argument #1 is not an array in xxx/sites/all/modules/location/location.module on line 1409.
warning: array_merge() [function.array-merge]: Argument #1 is not an array in xxx/sites/all/modules/location/location.module on line 1409.
Comment #2
bdragon commentedDuplicate of #346988: [master] Argument #1 is not an array.
Comment #3
pinxi commentedRe-opening this request.
This is for 5.x-3.0:
#346988: [master] Argument #1 is not an array
I am using:
I have the same issue as described above. Two array errors on Edit:
-pinxi
Comment #4
yesct commentedmarked #411982: warning: array_merge() a duplicate of this issue
Comment #5
karens commentedSee:
Note that $location (which is never defined) is used in location_invoke_location(). I don't know if that was supposed to be
location_invoke_locationapi($settings, 'defaults');or something else.Comment #6
karens commented$location is defined further down, I'm guessing it just needs to be moved up before location_invoke_locationapi(). Patch attached.
Comment #7
jeffschulerbump.
same thing for 5.x-3.x-dev...
Comment #8
bricef commentedI had the same problem due to a malformed settings. I corrected the problem like this :
Comment #9
bdragon commentedhttp://drupal.org/cvs?commit=303132
http://drupal.org/cvs?commit=303134
http://drupal.org/cvs?commit=303136
Committed #6/#7 patch.
Comment #10
jefftrnr commentedI still get the error, unless I change the same bit of code to:
"locpick" seems to be missing it's defaults settings.
Comment #11
sirkitree commentedsubscribe - this seems to be causing errors with submission too.
Comment #12
sirkitree commentedJust needs to be a bit more robust I think... try
*EDIT*
I'll also note that this error was completely making so that my node, with a location_cck field, would not be created at all. So in my case it was not just 'lockpick' that was not set, but cck-something-or_other as well. Using this fixed that and would fix any key that happens to be within
$settings['form']['fields']and not within$defaults.Comment #13
yesct commentedI think this is just a problem for some people, not all. Any idea what combination of situations causes the problem? Can you make a new test site using the new dev release, with just location, and document the steps you go through to reproduce the error?
Comment #14
todd zebert commentedsame issue. subscribe. going to try Dev version.
Comment #15
yesct commentedI haven't taken my own advice and done a simple blank test site to recreate the error (yet). But I did start getting the error when I upgraded to the new dev, for example on my add user form (where I have cck locations in the content profiles). Attached the patch suggested in #12 by sirkitree (it got rid of the errors for me)
Comment #16
yesct commentedsteps to reproduce:
clean site 6.16 with modules:
Administration menu 6.x-1.5
Content Construction Kit (CCK) 6.x-2.6
Includes: Content, Fieldgroup, Option Widgets, Text
Location 6.x-3.0
Includes: Location, Location CCK
Poormanscron 6.x-2.2
Includes: Poormanscron
Views 6.x-2.10
Includes: Views, Views UI
Add a new content type, add a cck location field, create a node of that content type and should get the error.
Comment #17
yesct commentedtagging
Comment #18
yesct commentedmarked #662250: warning: array_merge() as a duplicate of this issue
Comment #19
modulist commentedFIX: Try upgrading to version 6.x-3.1-rc1 or better
I ran into this issue migrating from one server to another. The original server was running version 6.x-3.1-rc1, while the destination server was running the older 6.x-3.0.
Not only were we getting the line 1409 error, but no one was able to update or add any nodes in certain content types that used Location CCK fields.
An upgrade to 6.x-3.1-rc1 resolved these issues.
Comment #20
rooby commentedThis is already fixed in 6.x-3.x-dev. I'm not sure when but the current code for that part (#15) is now:
Can you confirm the problem is fixed in the latest dev?
Comment #21
ankur commentedThis looks fixed to me.