Active
Project:
OG Forum Resurrection
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 May 2011 at 04:23 UTC
Updated:
14 Jun 2011 at 03:34 UTC
Jump to comment: Most recent file
Not entirely sure of the circumstances at the moment, been trying to track this down.
May be related to:
http://drupal.org/node/1168000
More details to follow, unless you guys can recognize it right off and fix.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | og_forum.module-1168010-1.patch | 1.27 KB | pro.methean |
Comments
Comment #1
pro.methean commentedSimilar to my patch for #1168000: Non group member posting into a public forum - taxonomy failure, I found a spot to allow for an unconfigured public:
og_forum_resurrection: og_forum.module: line 484: og_forum_nodeapi()
Submitted patch has bug fixes for both this issue and #1168000: Non group member posting into a public forum - taxonomy failure.
Have tested and new posts to private forums are still private.
(FYI - Does not fix old forum topics, only newly created ones after fix is applied.)
Comment #2
pro.methean commentedAm thinking this patch is probably not correct.
It worked in testing, but now it is not, these og forums seem annoyingly random for me this way.
I've spent a fair amount of time ripping apart the code and SQL to figure this out.
The "elseif ($node->type == 'forum') {" section of og_forum_nodeapi() (line 460+) is pretty dizzying in its complexity, but one thing I am noticing is that og_access_post.og_public deals with a binary true false, and the og_term.public is a quadstate based on the constants defined in the beginning of the file, 0&1 meaning private, 2&3 public.
One disturbing thing to me is that PUBLIC_BY_GROUP_OWNER is not use anywhere in the file, and thats my most common use case. Although I do see in two places comparisons to PRIVATE_BY_GROUP_OWNER which sort of counts.
Personally I am not at all used to setting publicity on a forum topic, in most forum environments the forum container is what dictates the visibility and when the container changes the topics should follow.
At this point somewhat tempted to boil this module down to handle my use case, since the PUBLIC_AUTO and PRIVATE_DEFAULTs are confusing the hell out of me with no benefit (to me), whatsoever.
Still working on this.
Comment #3
pro.methean commentedI've come up with some SQL that I am using to audit and fix my DB (fix with on caveat and a question).
After executing the fix code the forum topics still have the wrong visibility, BUT if do an edit then save they are corrected. How do kick Drupal in to re-evalling the visibility without edit the 200+ topics that need to be fixed?
Comment #4
pro.methean commentedThe above audit code above in #3 fails to take into account that term_node is a versioned link table. The vid in term_node stands for "version id", not "vocabulary id" as one might expect in a taxonomy related table. So you need to do a few gyrations to get the latest version (namely joining the table to itself after grabbing the max for the nid).
Proper audit join is:
With either of these two where clauses:
Oh if anyone wants to instruct me on cleaner SQL, please feel free :)
So to fix this bug for myself, I've added some code to og_forums.module:starting line 777: og_forum_form_alter():
I don't think this covers all cases yet, but what it does is properly default the public checkbox.
I think you need to enable the checkbox for this to work.
- Pro
Comment #5
pro.methean commentedSo I am still using the above update code.
I did get a few problems in cases where the forum topics had been moved from a private forum to public and vice-versa, due to the term_node versioning, I could probably fix, but I only had three cases which came up in the audit code, and I fixed by hand.
Used the Rebuild permissions: admin/content/node-settings "Post Settings" after SQL execute to get this to stick.
- Pro