Closed (fixed)
Project:
OG User Roles
Version:
5.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
3 Jul 2007 at 21:50 UTC
Updated:
7 Jul 2007 at 21:03 UTC
Jump to comment: Most recent file
see toward the bottom of this discussion: http://drupal.org/node/141103
As you can see by the above referenced post, I'm doing a work-around for now, but I'm not sure that it's the best solution. For now, it will work, but who knows what we'll be adding in the future. So, I'd prefer it if OG User Roles didn't break the URL to begin with. I'm willing to work with you on a solution that meets both module's needs, but I haven't had a chance to delve into your code yet.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | og_user_roles.module.070704.patch | 2.59 KB | somebodysysop |
Comments
Comment #1
somebodysysop commentedWithout getting into the whole sordid story, suffice to know that performing it's own node_access check before executing node_add (what ognodeadd does) was the only way to get og user roles to work every time.
That said, I am willing to work to ensure that og user roles will work with og forum.
My guess is that there is some hook og_forums is performing during the node_add process that is looking for arg() values that have been altered by my code. Correct? If so, if you could point me to the function in question, perhaps I can work out some sort of patch.
My idea is that if og_forums is looking for:
/node/add/forum/$tid
I could modify my code to say: /ognodeadd?type=forum&tid[]=$tid&gids[]=$gid
And then, create a patch in the specific function that would look for the tid value instead of arg(3), or type = 'forum' instead of arg(2), or arg(1) = 'ognodeadd' instead of 'add'.
If not, then I'm open to any suggestions you may have.
Sorry for the bother but, as I said, this was the only way I was able to get the module to work perfectly every time.
Comment #2
rconstantine commentedThere are several functions that look for various args. I don't have a problem writing
if (module_exists('og_user_roles')) {blah blah}in order to handle your urls. Off the top of my head, yes, we are looking for node/add/forum/$tid. I'll double check if there are any other scenarios and post them here. Then, if you'll take care of your module, and then just tell my your plan, I'll take care of og_forum. What you've proposed already is very workable on my end.Thanks for the cooperation.
Comment #3
somebodysysop commentedHere's a patch against the latest version of og_user_roles.
The only url that og user roles hijacks is "/node/add", so I would assume that anything else your module is doing outside of node creation would not be affected by og user roles.
I looked at your code here http://drupal.org/node/141103 and see that if there is a group context, you add "gids" to the url. If there is not a group context, og_user_roles doesn't care because it's only for group content.
The attached patch will take this url:
and change it to this:
If this patch will do the trick, then I'll commit it as soon as you let me know.
Thanks.
Comment #4
rconstantine commentedSo that I'm clear on this:
I would then look for ognodeadd as my arg(1) and then explode(?) the query with '&' as the separater, and then split the substrings via the '='? Is that right? I haven't done much string parsing lately. Or are each of the arguments put into a global variable somewhere? Is it in $_GET?
Other than my clumsiness in completing my end, what you've got should be just fine.
Comment #5
somebodysysop commentedYes.
Yes. This should get them:
So, if
arg(1) == 'ognodeadd' && $type == 'forum', then you do your thing.Thanks for working with me on this.
Comment #6
rconstantine commentedAdjusted og_forum and all seems to work. I committed my stuff to CVS. Will you be doing the same?
Comment #7
somebodysysop commentedCommitting changes now.
Comment #8
somebodysysop commented