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

TechMosaic - October 1, 2008 - 07:59
Title:warning: array_merge()» warning: array_merge() argument #2 is not an array

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

TechMosaic - October 1, 2008 - 08:17

Just realized this is related to this post:

http://drupal.org/node/309272

Reverting to views rc1 resolves the issue.

Sorry for proliferating

#3

usapmaster - October 2, 2008 - 00:08

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

ronan - November 12, 2008 - 03:48
Status:active» fixed

#5

System Message - November 26, 2008 - 03:53
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#6

keva - January 26, 2009 - 19:50
Version:6.x-1.0» 6.x-1.1

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

keva - January 26, 2009 - 19:51
Status:closed» active

#8

beckyjohnson - October 5, 2009 - 18:48
Version:6.x-1.1» 6.x-1.2
Category:support request» bug report

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

crozilla - October 27, 2009 - 05:51

Getting same error with Node Hierarchy 6.x-1.2

#10

Anybody - November 7, 2009 - 12:44

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.

 
 

Drupal is a registered trademark of Dries Buytaert.