Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#15 | nh_argument_fix-299824-15.patch | 846 bytes | jbylsma |
Comments
Comment #1
TechMosaic CreditAttribution: TechMosaic commentedI 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?
Comment #2
TechMosaic CreditAttribution: TechMosaic commentedJust realized this is related to this post:
http://drupal.org/node/309272
Reverting to views rc1 resolves the issue.
Sorry for proliferating
Comment #3
usapmaster CreditAttribution: usapmaster commentedI 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.
Comment #4
ronan CreditAttribution: ronan commentedComment #6
keva CreditAttribution: keva commentedI 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.
Comment #7
keva CreditAttribution: keva commentedComment #8
beckyjohnson CreditAttribution: beckyjohnson commentedI 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
Comment #9
crozilla CreditAttribution: crozilla commentedGetting same error with Node Hierarchy 6.x-1.2
Comment #10
AnybodyHello!
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.
Comment #11
Gabriel R. CreditAttribution: Gabriel R. commentedI confirm that the solution in comment #10 works. Thanks, Anybody!
Comment #12
deruitern CreditAttribution: deruitern commentedThis is still a bug in nodehierarchy 1.3. Anybodys solution from #10, still worked for me, but the line number is now 136.
Comment #13
pdbob CreditAttribution: pdbob commentedJust to confirm, the final line 136 should look like this-
if ((!$first_arg || ($first_arg['field'] !== "parent" && $first_arg['field'] !== "antecedent") || $first_arg['table'] !== "nodehierarchy") and is_array($view->display['default']->display_options['arguments'])) {
Is that right?
The error went away and everything seems to be fine
Comment #14
deruitern CreditAttribution: deruitern commentedSame bug exists in nodehierarchy 1.4. I'm using the lastest version of views, currently 6.x-2.12. Same solution as #10 from above, but the line number is 135.
Comment #15
jbylsma CreditAttribution: jbylsma commentedI took a look into this today. I was able to reproduce the behavior if I created a view that didn't have any arguments. Funny thing was that I could disable it if I added an argument to said view, saved it, then deleted the argument and resaved. Any which way, as opposed to the previously mentioned patches, I've added logic to populate an array for arguments if one doesn't exist. I realize that this is a pretty old issue, but could some eyeballs take a look at this before I commit it to 6.x-1.x-dev? I've made the patch based on 6.x-1.4. Thanks!