Posted by yhzsailor on December 14, 2008 at 9:53pm
7 followers
Jump to:
| Project: | Location |
| Version: | 5.x-3.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I upgraded today and get the following error when trying to create a node which references a location:
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/bnewsome/public_html/modules/location/location.module on line 1385.
Interestingly this does not occur on another node type which also has a location.
Thoughts?
Comments
#1
I'm having the same problem (above mentioned warning) with 5.x-3.0 running Drupal 5.14. It exists in all nodes in which I'm using location. When I try to change a location the address updates but the lat/long coordinates do not recalculate and are blank. I used the "delete" box to clear the previous location before inputting the new one. Clearing cache...reinstalling module have no effect.
#2
I got the same problem. Then I opened the edit page for the content type that uses location, and re-submit the content type setting. After that, when I opened the edit page of the nodes of that content type, I saw no more of this error message.
#3
I found a solution at http://drupal.org/node/36408
As a result of this hint, I modified location.module line 1387 (at least that's the line in my modified location.module) to read something like this (extra lines for the complete function listed for context.)
/*** 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((array)$defaults[$k], (array)$v);
}
}
The only change is the addition of (array) before each parameter in the call to array_merge on line 1387. That got rid of the error message and I'm presuming that this has fixed the issue and it is not silently failing.
#4
Same issue with 5.x-3.0 & Drupal 5.14.
Making yhzsailor's changes fixed the issue for me.
Thanks Yhzsailor!
#5
I suddenly started having these same problems, but the above patch worked.
#6
Fixed this yesterday. It was attempting to blindly merge in form elements that had been tacked on.
Thanks for the report!
http://drupal.org/cvs?commit=163493
http://drupal.org/cvs?commit=163494
#7
Automatically closed -- issue fixed for two weeks with no activity.
#8
Marking as master and changing to fixed again for visibility.
#9
Duplicates marked.
#356806: Fatal error and white screen of death. Location will not accept entry of location data
#362911: warning: array_merge() [function.array-merge]: Argument #1
#381498: Argument #1 is not an array... location.module on line 1409.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.