Closed (duplicate)
Project:
OG Forum D7
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
31 May 2013 at 21:32 UTC
Updated:
22 Oct 2021 at 17:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedPatch attached
Comment #2
ibullockPatch didn't apply cleanly for me (probably because I have patched the module about 4 other times), but I did want to note that this fixed and issue for me where forums produced a 404 error for anonymous users.
Comment #3
PascalAnimateur commentedThe patch applies ok, but it generates an error because the variable $user_groups is not initialized (just change the line above to $user_groups instead of $groups and it works).
But the patch doesn't do what it's supposed to do.. the group forum is still visible to non-members in the forum listing.
Anybody managed to hide the forums for non-members ?
Comment #4
hoersche commentedPatch attached that incorporates the needed above patch, fixes the $user_group variable, and fixes an OG 2.x renaming issue in og_forum_query_term_access_alter (og_group_access should be og_group_ref) that was causing nothing to match the forum taxonomy terms used to restrict access.
Comment #5
reswild commentedThe patch in #4 worked for me for fixing what is shown on forum list pages, but in order to get the right access control for the forum posts themselves, I also had to change the following line in og_forum_form_forum_node_form_alter() (at line 170):
from
$user_group = og_get_entity_groups();to
$user_group = og_get_groups_by_user();Comment #6
jojonaloha commentedMarking as duplicate of #1844104: non-group-member can post in private forum since it is older and handles both issues with taxonomy term access and the node access.