Closed (fixed)
Project:
Author Pane
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2009 at 21:13 UTC
Updated:
11 Jan 2010 at 13:35 UTC
the default implementation doesnt check if a group is set to private before including it on the list
there should be some way to configure this per role but OG lacks it and i might take this to them if i get a chance to work on it, so the below might need some work on OG before it will be useful, i think it should be included anyway because it obeys OG's logic
im actually using the below + a check for role but that hack doesnt belong to this patch :-)
--- author_pane/modules/og.author-pane.inc 2009-09-02 14:04:08.000000000 -0700
+++ author_pane/modules/og.author-pane.inc 2009-09-02 14:08:22.000000000 -0700
@@ -15,7 +15,10 @@ function og_preprocess_author_pane(&$var
if (isset($account->og_groups) && !empty($account->og_groups)) {
$groups = array();
foreach ($account->og_groups as $og_id => $og) {
- $groups[] = l($og['title'], 'node/' . $og['nid']);
+ $og_node = node_load($og['nid']) ;
+ if ( ! $og_node['og_private'] ) {
+ $groups[] = l($og['title'], 'node/' . $og['nid']);
+ }
}
$variables['og_groups'] = implode(', ', $groups);
Comments
Comment #1
abaddon commentedplease change the above line "+ if ( ! $og_node['og_private'] ) {" to "+ if ( ! $og_node->og_private ) {" before using it.. oops
Comment #2
michelleAh, thanks for that. I only have one private group on my site and it never even occured to me. I'll put it in 2.x. 1.x is going to be deprecated as soon as I can get 2.0 released.
Michelle
Comment #3
abaddon commentedno problem, sorry for not putting it in a patch file but i was in a rush to finish off a site, i guess its not needed anymore now
thank YOU Michelle :-)
Comment #4
michelleNo worries. I don't mind doing the copying and pasting myself. I didn't get this added, yet, but will before I do the next alpha.
Michelle
Comment #5
michelleOk, I committed a slightly modified version. All those extra node loads are performance killers so I check to see if og_access is even enabled before checking for private groups.
Thanks,
Michelle
Comment #7
dries arnoldsIf a user is a member of only private groups, the word 'None' doesn't appear. Maybe it shouldn't (cause the user is a member of prinvate groups), but there should be something mentioned there.
Maybe 'Groups: no public groups'