Forum taxonomy menu not populated when creating new node
kentr - September 17, 2009 - 16:33
| Project: | OG Forum |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | paulbooker |
| Status: | needs review |
Description
(continued from http://drupal.org/node/555964)
Description:
In certain circumstances when creating new topics, the "Forum:" menu is not populated with choices. Since that field is required, this issue prevents the user from being able to create the node.
Repeatable:
Always
Steps to repeat:
Click the "Create new Forum topic" link (specifically, it's the path node/add/forum that causes the problem).
Details:
The issue appears to be in og_forum_db_rewrite_sql() (og_forum.module), when $_GET['qids'] is unset.
Some proposed solutions are in the previous thread.

#1
Specific comments referencing this issue in the previous thread:
http://drupal.org/node/555964#comment-2041694
http://drupal.org/node/555964#comment-2048260
http://drupal.org/node/555964#comment-2050744
http://drupal.org/node/555964#comment-2051124
#2
Here's what I've tried with the query.
Change these lines:
og_forum.module ~line 416
<?phpif (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum' && empty($_GET['gids'])) {
$return['join'] = "LEFT JOIN {og_term} ogt ON t.tid = ogt.tid";
$return['where'] = "ogt.nid IS NULL";
?>
to:
<?phpif (arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'forum' && empty($_GET['gids'])) {
$return['join'] = "LEFT JOIN {og_term} ogt ON t.tid = ogt.tid LEFT JOIN {og_uid} u on u.nid = ogt.nid";
$return['where'] = "(ogt.nid IS NULL OR (ogt.nid = u.nid AND u.uid = {$user->uid} )) ";
?>
Seems to be working with User 1 and an Authenticated User (typical permissions), under these conditions:
Needs to be tested with:
The existence of forums not in a group (whereTested: OKogt.nidis NULL)#3
Here's a patch for the above.
#4
#5
I have a single site wide forum and can see that when i go /node/add/forum
#6
@#5
Sorry, I'm confused. Does that mean your test case is working as intended?
I dug into publicity a little more. Does the publicity of the forum need to be considered at this point the code (
og_forum_db_rewrite_sql()), or is that handled somewhere else? Note: publicity issues appear to be related to http://drupal.org/node/579734If they need to be considered in
og_forum_db_rewrite_sql(), need info on the status codes.Questions:
ogt.public > 0somewhere in the query)?#7
Thanks for the patch! It's working for my "authenticated user" who belongs to the private group that has this forum.
#8
Thanks for all your help here kentr
I'll have a look at this tomorrow as a priority.
Best, Paul
#9
"In certain circumstances when creating new topics, the "Forum:" menu is not populated with choices. Since that field is required, this issue prevents the user from being able to create the node."
Would you mind clarifying exactly what the circumstances were so that i can repeat the problem
and investigate more efficiently.
If there are no site wide forums defined then it is true that you will not be able to make a post
on /node/add/forum (not sure if that helps)
#10
Paul,
Sorry it wasn't clear...
One example based on my setup (from memory. I can't repeat b/c I'm using the patch above):
Steps to repeat
Example:
/forumnode/add/forumornode/add/forum/nnwithoutgidsin the path.Update:
I just noticed this:
Ok, didn't know you were aware of this. This is the bug, IMO.
Expected behavior:
Clicking a link entitled "Post new Forum topic" that leads to
node/add/forumwill allow user to successfully create a forum topic.Proposed solution:
og_forum_db_rewrite_sql()) so that in cases where$_GET['qids']is unset, the query returns all forums for which user has permission to post, regardless of whether there are site-wide forums defined. That's what patch #3 is attempting to accomplish.#11
Updated previous comment for clarity & details.
#12
Updated #10 to more succinctly state proposed solution.
#13
Subscribing.
#14
Subscribed
#15
subscribing - for me this issue appeared with the last update
#16
subscribing - I am experiencing the same with version 6.x-2.0. I can select forum in the OG forum, but not in any other. I tried the patch, but to no avail. I got no error reports from using the patch.
Edit: I closed the new issue I made for the 6.x.-2.0 version, and post the information here instead (on suggestion from kentr.)
Description
Repeatable: Always
Steps to repeat:
Expected results:
The forum dropdown list populated with the forums the user have access to post to.
Actual results:
The forum dropdown list is empty ("please select" being the only entry). It is not possible to add new forum topic.
Further details:
After updating OG forum to the latest version (6.x.2.0) it is no longer possible to add new forum topics via the URL node/add/forum, since the forum taxonomy dropdown is not populated , neither as anonymous, authenticated user or user 1.
If I make forum topics as a group member into the OG forum - node/add/forum/83?gids[]=147 - the dropdown is populated with the OG forums.
If I deactivete OG forum everything works as it should (except of course now the former OG forum appears in the forum list for all users).
We have the following forum structure - admin/content/forum:
Settings:
Organic groups access configuration admin/og/og_access >
Private groups
OG forum admin/og/og_forum > group forum container >
Content type forum - admin/content/node-type/forum >
Hope someone can clarify what has gone wrong. The error happened after a lot of modules being updated + Drupal core updated to 6.14 - so other things might play a role!
#17
For cases when the patch didn't work: any errors, or did the patch just not apply?
If it were me, I'd appreciate having the threads combined, even though they're different versions. Easier to keep track of, and many people are already subscribed to this thread.
#18
Here's a new patch against 6.x-2.x-dev, 2009-Nov-11.
Please also look for issues with non-public forums showing up in the dropdown when they shouldn't.
#19
Yesterday I un-installed the old version of OG forum completely before I tried with the 6.x-2.0 version. This brought back the taxonomy in the dropdown - but suddenly the former hidden og forum (minus threads/nodes) was also visible to non-members. I tried to fiddle around to make it work, but couldn't.
Today I did the same with the 6.x-2.x-dev, 2009-Nov-11 version and the og_forum-580452-18.patch. The result was the same - the dropdown populated, but the og forum visible to non-members at /forum. After I set the group forum container to the "old" one at OG forum admin/og/og_forum > group forum container >, this container and its forums disappeared from the dropdown menu - both for non-members AND members. It is as if the old og forums (and/or container?) needs to be reconnected to the group/defined as og forums once again?
I thought about choosing the "retroactively update old groups" option, but I am not sure this will help me out, since I already have my forums.
#20
I can possibly fix the issue with hidden forums showing up because of the patch, but I need more information on hidden forums since I'm not familiar with them.
@benjamin_dk (or someone else):
What are the conditions under which a forum is hidden? And if possible: how is that info stored in the database (what table / column)?
#21
As far as I can see from og_forum.module, the conditions that control the visibility of a forum has to do with the og_forum_is_public-function (line 1294). Here a row from the og_term table is tested for content and the status of the public-field.
When I look in my DB I can see, that I have no content in my og_term-table! I guess this is where my old og-forum ought to be?
Here are some more values from the DB regarding my old og-group that might be relevant:
Organic Group-table "og":
og_selective: 1
...
...
og_register: 1
og_directory: 1
og_private: 0
#22
Patch #18 worked for me, subscribing.
#23
Currently if you go to /node/add/forum you will only see the public forum or no forums if you have no public forums.
This approach looks to allow you go to /node/add/forum and see both public forums & group forums for groups the user is subscribed to. Is this what is being called for here? (Sorry i don't have the time to go through the whole thread right now)
Best,
Paul Booker
#24
Yes.
#18 adds a join to group membership tables to accomplish this.
According to #19, my patch had an undesirable side-effect. Haven't had time to look into it.
#25
Making sure I understand: the formerly hidden forums suddenly appeared in the forum listing at
/forum, not in the taxonomy dropdown on the node edit form, correct?In other words, after the patch, the taxonomy menu was working as you expected / desired, and the main forum view page was not?
Please open a new issue for this, since this appears to a separate issue (sounds like it the empty
og_termtable is part of this problem).#26
#19: I can't recreate this problem. How are your private forums set up?