I haven't had a chance to switch/upgrade to 2.4 yet, so if I need to let me know.
Anyway, I have a module called Content Type Administration by Organic Group.
Within that module, I restrict the content types available to users based on the group they are currently in. I do not use roles in that determination. However, I am overriding the normal og_block_details function with my own and my module weight is set to 3.
I assume this is a problem somehow since a menu item that should be showing up, by virtue of the fact that a user is assigned a role to a particular group via your module, is not showing up.
In what way do I need to change my module so that it plays nice with yours. Do you have a firing order that I need to follow? Will weighting your module heavier do the trick? Please advise.
Comments
Comment #1
somebodysysop commentedYes.
We do use roles to make that determination. And, that's the only thing we use.
Not necessarily. It might not show up if we can't establish group context or if we don't recognize the URL as a group URL. You don't mention where the menu item is not showing up. That is, is it not showing up in the Group Menu when you are on the Group Home Page? What is the URL where it is not showing up.
First, establish if the item you are referring to shows up when OGR is installed and your module is NOT installed. Next, establish whether it shows up when OGR is NOT installed and your module is installed. I assume it shows up when neither module is installed.
You may want to use the OGR "Clear the cache" setting to see if that makes a difference.
Also, see if weighing yours heavier than OGR works (although I doubt that will make any difference).
If it doesn't, then I need to know the URL in question.
I can't really speculate right now since I don't have a lot of information, but I can tell you that on the default Group Home Page (i.e., /node/GroupID), OGR will always respond with the correct roles for a user, particularly with the "Clear the cache" http://drupal.org/node/166566 setting on.
Comment #2
somebodysysop commentedWhoa! What was I thinking?
Just submitted a patch the other day which implements hook_og_user_roles_gid. If this is an issue, as I suspect, of OGR not recognizing the group context, your module can supply the group node ID to it directly.
http://drupal.org/node/176390
Try it and see if it doesn't resolve your issue.
Comment #3
rconstantine commentedThe problem may lie in the fact that I'm using pathauto since you mention there may be a problem with finding the group context. My path that's giving my trouble is sunrise-douglas-moms-and-kids which is the group name. I'll try your hook. However,...
I'm not having a problem with my Content Type Admin module in determining the group context, so I wonder why your module is. Your module isn't looking at the URL to determine context is it? I'm pretty sure I remember seeing plenty of og_get_group_context() calls in your code.
BTW, with my module off, but pathauto still on, I have the same problem.
So I think it's a pathauto compatibility issue maybe.
Either that, or your module hasn't loaded the $user with all of the roles they should have before I fire off
$links = module_invoke_all('og_create_links', $node);. LIke I said, I hijack the original og_block_details function which would usually fire that invoke function. Perhaps I could force-load the roles from my module to see if that fixes things? What function(s) would I use to do that?I'll let you know if using that hook does the trick. Meanwhile, you may want to see about the pathauto thingy.
Comment #4
rconstantine commentedWell, nevermind. It seems I failed to see your 'reset' option. Using that seems to fix everything. I did upgrade to 2.4.
Thanks for your trouble.
Comment #5
(not verified) commented