warning: array_merge() argument #2 is not an array
johnpv - August 25, 2008 - 18:59
| Project: | Node Hierarchy |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I'm getting a warning when incorporating one of my views, funny thing though, my other view which is almost identical doesn't throw a warning.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /sites/all/modules/nodehierarchy/nodehierarchy_views/nodehierarchy_views.module on line 119.
* warning: Invalid argument supplied for foreach() in /sites/all/modules/views/includes/plugins.inc on line 760.
Have you seen this before? Suggestions on how to fix would be great.

#1
I am seeing a similar issue.
This was on a view and node hierarchy config that was working on drupal 6.3...but when I upgraded, I see this error.
I tried upgrading and downgrading the views and node hierarchy modules, but to no avail.
Any ideas on how to clear this up?
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/mysite/public_html/sites/all/modules/nodehierarchy/nodehierarchy_views/nodehierarchy_views.module on line 119.warning: Invalid argument supplied for foreach() in /home/mysite/public_html/sites/all/modules/views/plugins/views_plugin_display.inc on line 509.
#2
Just realized this is related to this post:
http://drupal.org/node/309272
Reverting to views rc1 resolves the issue.
Sorry for proliferating
#3
I am having the same problem. any solution to this? I upgrade views to rc4 but still having the same problem. It was working prior to upgrade from rc1 rc3. where can i find rc1 so i can revert back? I did not back up since my site is still not up.
warning: Invalid argument supplied for foreach() in /home/mysite/public_html/modules/views/plugins/views_plugin_display.inc on line 509.
#4
#5
Automatically closed -- issue fixed for two weeks with no activity.
#6
I upgraded to D6.9, and just started to use NH 6.x-1.1 and Views 6.x-2-2.
Similar error messages as the OP's are being generated:
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /sites/all/modules/nodehierarchy/nodehierarchy_views/nodehierarchy_views.module on line 117.
* warning: Invalid argument supplied for foreach() in /sites/all/modules/views/plugins/views_plugin_display.inc on line 509.
#7
#8
I too am now getting this issue:
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/vhosts/myurl.org/httpdocs/sites/all/modules/nodehierarchy/nodehierarchy_views/nodehierarchy_views.module on line 151.
warning: Invalid argument supplied for foreach() in /var/www/vhosts/myurl.org/httpdocs/sites/all/modules/views/plugins/views_plugin_display.inc on line 547.
I do not want to downgrade to an older version of view to fix this though. I have this version of views: 6.x-2.6
Becky
#9
Getting same error with Node Hierarchy 6.x-1.2
#10
Hello!
I had the same problem and fixed it by changing line 134 in nodehierarchy_views.module:
if ((!$first_arg || ($first_arg['field'] !== "parent" && $first_arg['field'] !== "antecedent") || $first_arg['table'] !== "nodehierarchy") and is_array($view->display['default']->display_options['arguments'])) {
Added "and is_array($view->display['default']->display_options['arguments']" and brackets at the end of the check.
This seems to be a simple, but working fix with no dangerous results.