This seems like a permissions thing, but only admins have access to OG forums that have NOT been made public. I don't want my OG group forums to be public, so at least that's working (I had to disable to Advanced Forum module to fix this, which I wish I didn't have to do).

I've experimented, and all my OG members can access and post to OG forums if I make those forums public. But I want to have the choice of making some OG forums to be private. When I do, then members who are not administrators get a Access denied - You are not authorized to access this page when trying to get to a forum (or a "Page not found - The requested page could not be found" when clicking on the Forum tab for the group).

I've set permissions in the forum module so that any authenticated user can create forum topics and edit own forum topics, and (just in case) in the og_forum module any authenticated user can admin own group forums and make forums public.

I've even experimented with an autheticated user creating his own OG, but even then that user can't get to the forum for that OG.

I just discovered that I can get users with roles less than admin to access private OG forums if I set forum permissions for those roles set to be able to administer forums, but that seems pretty screwy to me. I don't wnat them to be able to administer those OG forums, I just want them to be able access them and post to them. Am I missing something here?

I'm using Drprual version 6.13.

CommentFileSizeAuthor
#37 og_forum-549542-37.patch1.16 KBc4rl
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BetaTheta’s picture

Same issue here

Leeteq’s picture

Subscribing.

BetaTheta’s picture

Problem still occurs in RC4

BetaTheta’s picture

And also, I don't if this will help, but this issue was not there in RC1. I'm using RC1 on one of my sites with two patches (group tab and hide og forums in main forum list if user is not member of that group).

So my best guess would be the issue came up somewhere between the transition of RC1 to RC3

dazweeja’s picture

OK, just to troubleshoot, the 2 lines that will most likely deny access in this case are:

if (!user_access('access content')) 

and

      if (!(is_array($user->og_groups) && array_key_exists($gid, $user->og_groups)) && ($user->uid != 1) && !(user_access('administer forums')) && !og_forum_is_public($tid)) {

So firstly either your users don't have 'access content' permission or - the most likely fail point of the second line of code - the id of the group the forum is associated with (ie. $gid) does not appear the array of the logged-in user's groups ($user->og_groups).

Is there any chance that either of these aren't true in your case, ie. the users don't have 'access content' permission or that they are not a member of the group that the forum is associated with?

dazweeja’s picture

Also, if you have the Forum Access module installed, make sure you check the permissions in the Access Control section for the affected forums.

rboedeker’s picture

I had the same trouble until I added "administer nodes" permissions (node module) to the role.

Leeteq’s picture

Version: 6.x-2.0-rc3 » 6.x-2.x-dev
Anonymous’s picture

Coming to this shortly.

Anonymous’s picture

Assigned: Unassigned »
dazweeja’s picture

For those experiencing the problem, it might also be helpful to know which version of OG you are using. Also versions of any other forum related modules that you have installed (eg. Advanced Forum, Forum Access, etc). It shouldn't be necessary to assign 'administer nodes' or 'administer forums' permissions so there must be something else going on.

tallsimon’s picture

I have this issue too. using

OG forum 6.x-2.0-rc5 (but dev has same problem)
Organic groups 6.x-2.0
Drupal 6.13
Was using advanced forum, inactivating that (after reading http://drupal.org/node/386566 ) did not help.

Would love help with this...

dazweeja’s picture

I still can't replicate. In the Organic Groups fieldset for the Forum Topic content type, is it set to Standard (or Wiki) group post?

Do you have the same issue if trying to access the forum through the regular forum list, ie. http://_your_site_/forum

bailsbails’s picture

I have the same issue

drupal-6.14 og_forum-6.x-2.0-rc5 og-6.x-2.0

With both the Organic Groups fieldset for the Forum Topic content type set to Standard and Wiki group post?

And yes I have the same issue if I try to access the forum through the regular http://my_site/forum

Thanks

tallsimon’s picture

I can confirm this as #14 states

i don't know if it is relevant, but i created all groups under 1 container using the OG forum function, then moved some of them to other containers, but even the ones I did not move don't work.

the posts within the forums work (i.e. group permissions are ok), it is simply the forum pages themselves which deny access

tallsimon’s picture

My vocab ID for forums is 55 rather than 1, I wonder if this is messing with things...

tallsimon’s picture

with fresh install, it all plays nice. with old install, it doesn't. i really suspect a vocab ID issue, how do I change the vocab ID of forum vocab? changing it in the table
vocabulary or vocabulary_node_types does not seem to do this.
Any ideas?

Anonymous’s picture

Assigned: » Unassigned
joemaine’s picture

I have this issue too. using

OG forum 6.x-2.0-rc5
Organic groups 6.x-2.0
Organic groups Views integration 6.x-2.0
Organic groups actions 6.x-2.0
Organic groups access control 6.x-2.0
OG Block Visibility 6.x-1.2
Drupal 6.14

mstephan’s picture

I only experience this problem if the module menu_breadcrumb is activated.

BetaTheta’s picture

I think I finally figured out why I am having this issue. My organization has local chapters. And every member is in a chapter.
So for example member A with role A is in chapter A (group).

I noticed that Member A could not accesss forums from the group page, but he could from the main forums list. But then I paid a bit more attention. Member A could not access forums/31. I found out forum/31 was the container for the group.

On the main forums list, member A couldn't access the forum/31 container, but he could access the 'General Discussions' forum underneath it.

So basic overview:
Member A
- role A
- group A
- can't access forum containers (whether from group or main forums)
- can access group forums

I have the Forum Access module enabled. So I went to its settings page, went to the group A container and noticed that only authenticated members could view the forum container. And only authenticated and anonymous users can see the forum in the main forum list.

So I changed both settings to only for role A. And it worked!!!.

So I think the issue is some collision between Forum Access and OG Forums. They might be colliding. And obviously my solution only works assuming all members in your group have the same role and you have/had Forum Access enabled.

joemaine’s picture

It is indeed the module menu_breadcrumb. I turned it off and the private funtionality works. I don't have Forum Access. Thanks for the sleuthing mstephan! Now...is there a solution?

dazweeja’s picture

I think the solution is to log a new job in the menu_breadcrumb issue queue. The problem is that menu_breadcrumb calls menu_get_item() in its hook_init() which stops _load functions working. menu_get_item() should not be called that early because other modules are still running menu-related functions. It breaks other modules like Project too, see #454682: Issues with project and menu_breadcrumb integration..

You could try setting the weight of the menu_breadcrumb module to some high value, say '99' although I'm not sure this would help as I think its hook_init would still cause issues.

@tallsimon, maybe you are looking for 'term_node' and 'term_data' which store information about the terms/tids for individual forums, ie. the terms that are in the 'Forums' vocabulary. 'og_term' relates the forum tids to the relevant groups.

tallsimon’s picture

thank you
will try turning off menu breadcrumb, good find!
@dazweeja, will try this table
cheers!

ptoly’s picture

I'm having a similar problem with Custom Breadcrumbs. When it's on, I get an access denied message. When it's off I don't.

Need to do some more testing but this is an FYI.

I'll post follow ups over in the CB issues...

rootwork’s picture

For those who are experiencing this as a result of Custom Breadcrumbs, see #627792: Custom Breadcrumb option causes Access Denied in OG Forums for a workaround. That's also where the fix, if and when there is one, would be posted.

rismondo’s picture

I an encountering a similar issue. For instance, let's say a user creates a new group, and right afterwards clicks on the "Forums" tab: the result is a message "The requested page could not be found". From the admin account the page appears just fine. I had the Menu Breadcrumb module active, so I was hoping disabling it was the solution, but even after disabling it I still get the same message. I tried uninstalling OG Forum, manually removing all the forums, then reinstalling and recreating them with "Update old groups", but no luck. Any ideas? Any further modules that may cause this kind of issue?

Branjawn’s picture

I do not use Menu Breadcrumbs or Forum Access and I am having this same problem. I am using 6.2 versions of OG and OG Forums.

Dries Arnolds’s picture

I also do not use Menu Breadcrumbs and have the same issue. I'm using:

Drupal 6.15
OG 6.x-2.0
OG Forums 6.x-2.2
Forum access 6.x-1.2

Maybe it's aforum access issue? I currently have no testsite where I can safely turn it off...

Dries Arnolds’s picture

@ Janam #21:
This only works in your case, because if not all members of a role are meant to have group forum access, they still do because of the forum access role settings. As the forum access settings say: it can only grant access, not revoke. So forum access grants access to all people in a role, regardless of their group membership.

jemmyw2’s picture

Replace the line in og_forum.module (line 157)

if (og_forum_is_public($tid) || (!empty($user->og_groups) && array_key_exists($arg, $user->og_groups)) || user_access('administer forums'))

with:

if (og_forum_is_public($tid) || og_is_group_member($arg) || user_access('administer forums'))

And it works, as og_is_group_member already has a work around for og_groups not being available.

kcheung’s picture

Hey jemmyw2, that worked! thanks.
was using OG forum 2.2

abaddon’s picture

ditto, this worked for me, but i was also getting an access denied page for the forum in question as the user who created the group, as site admin it displayed ok

ive found the same problematic code here: function og_forum_access_forum_page($tid = 0) {
and replaced with og_is_group_member

        if (!(og_is_group_member($gid)) && ($user->uid != 1) && !(user_access('administer forums')) && !og_forum_is_public($tid)) {
        return FALSE;
      }
Anonymous’s picture

Would anyone like to pull everything together here and provide a patch.

Description:
Repeatable: Always | Sometimes

Steps to repeat:

1.
2.
..

Expected Results:

Actual Results:

Detail & Proposed solution:

c4rl’s picture

Comment #23 alludes to premature menu access checking.

Some of you may be interested in a similar issue I discovered with the Global Redirect module: #720416: Menu access checking conflicts with other modules

Both of these issues stem from the fact that og_forum assumes the $user->og_groups is populated in the wildcard load function.

This gets to a fundamental question of best practices: Should wildcard load functions assume that all necessary data are available to proceed (e.g. $user->og_groups)?

-- Suppose the answer is yes. Implication: Modules running menu access checks before the menu system does natively will have to have very high weights. (This is what the Global Redirect patch does).

-- Suppose the answer is no. Implication: Modules with wildcard loader functions will need to fetch data if necessary. Present example:

...
if (!isset($user->og_groups)) {
  $user->og_groups = og_get_subscriptions($user->uid);
}
...
abaddon’s picture

but the above way to fix it is correct right? and without dwelling into the issue youve outlined?
ill roll up a patch (&& the rest of the required info) if its the correct way

c4rl’s picture

Status: Active » Needs review
FileSize
1.16 KB

@abaddon

This issue *appears* similar to the one I was having in conjunction with Global Redirect -- if indeed it is, I went ahead and created the patch to fix both circumstances.

tinker’s picture

Thanks c4rl, your patch fixed my issue probably caused by Global Redirect.

pepeelfrances’s picture

Thanks for the patch, works very well (fixed my issue, I was using the module menu_breadcrumb and OG forum 6.x.2.2).

Anonymous’s picture

Assigned: Unassigned »

I'll get this committed to the development branch later today.

Best,
Paul Booker
Appcoast

Anonymous’s picture

Status: Needs review » Fixed
Jeff Burnz’s picture

Status: Fixed » Active

Has this been committed - the DEV version has not updated since Dec 17th 09.

maverick14’s picture

I had the same problem here. The patch in #37 works fine. Thanks c4rl!
Please add the patch to the module guys...

Anonymous’s picture

Status: Active » Fixed

Done. Thanks for the reminder.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

doulos12’s picture

Was still having the same problem. Disabled Global Redirect without installing the patch. That fixed the problem.

jvieille’s picture

Assigned: » Unassigned

In Global Redirect, just untick "Menu Access Checking" which purposely says: "By default this feature is disabled to avoid any unexpected behavior"