Causes array_merge_recursive error w/ drupal_add_js
webchick - July 9, 2008 - 18:23
| Project: | OG User Roles |
| Version: | 5.x-3.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
When browsing around as user 1, the /first/ time you arrive on a path like ?q=og or a node within an organic group, you may get:
warning: array_merge_recursive() [function.array-merge-recursive]: recursion detected in /Applications/MAMP/htdocs/og/includes/common.inc on line 1682.I don't know if this is the exact cause, but in print_r()ing the $scripts array, it looks like the following is being added twice:
[og] => Array (
[group_context] => Array (
[nid] => 1
[title] => Some group
[type] => group
)
)I'm using the latest DRUPAL-5 checkouts of this module and OG. OG, OG Access Control (part of OG core), and OG User Roles are the only OG-related modules installed; I originally had more, but I limited it down to this module causing the problem.
If i had to guess, I'd say that og_set_context() is being called twice somewhere.

#1
I don't know if this will make any difference, but clean urls is a requirement for OGR.
Just to be on the safe side, I installed latest OG 5.x-7.3 and still do not see this problem as user 1. I know that OGR does not set the group context except under certain circumstances where it can not be otherwise determined -- but definately not when simply browsing to a group node.
The only time I've ever even seen this error has been in 6.x: http://drupal.org/node/278643
#2
Interesting.
cd sites/all/modules/og; cvs up -r DRUPAL-5--7-3did indeed fix the problem. Funny thing is when Icvs up -r DRUPAL-5again, I can no longer reproduce. Huh. Well I guess I'll mark it closed then. :)