Posted by rwohleb on September 1, 2009 at 2:09am
| Project: | OG Audience By Type |
| Version: | 6.x-1.0-rc1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
In the og_abt_flatten_groups() function, there are two places where it does an array_merge, instead of a straight concatenation. This has the effect of reindexing the array keys since the arrays have numeric keys. This is an issue because OG can normalize $node->og_groups by only using the array keys and ignoring the values. This will result in the post potentially being added to the wrong groups.
This:
$nids = array_merge($nids, $found);
Should be this:
$nids = $nids + $found;
and...
This:
$nids = array_merge($node->og_groups, $nids);
Should be this:
$nids = $node->og_groups + $nids;