(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.
Comments
Comment #1
kentr commentedSpecific 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
Comment #2
kentr commentedHere's what I've tried with the query.
Change these lines:
og_forum.module ~line 416
to:
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)Comment #3
kentr commentedHere's a patch for the above.
Comment #4
kentr commentedComment #5
Anonymous (not verified) commentedI have a single site wide forum and can see that when i go /node/add/forum
Comment #6
kentr commented@#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)?Comment #7
capellicThanks for the patch! It's working for my "authenticated user" who belongs to the private group that has this forum.
Comment #8
Anonymous (not verified) commentedThanks for all your help here kentr
I'll have a look at this tomorrow as a priority.
Best, Paul
Comment #9
Anonymous (not verified) commented"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)
Comment #10
kentr commentedPaul,
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.Comment #11
kentr commentedUpdated previous comment for clarity & details.
Comment #12
kentr commentedUpdated #10 to more succinctly state proposed solution.
Comment #13
sebzur commentedSubscribing.
Comment #14
chriskip commentedSubscribed
Comment #15
tobiberlinsubscribing - for me this issue appeared with the last update
Comment #16
benjamin_dk commentedsubscribing - 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!
Comment #17
kentr commentedFor 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.
Comment #18
kentr commentedHere'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.
Comment #19
benjamin_dk commentedYesterday 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.
Comment #20
kentr commentedI 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)?
Comment #21
benjamin_dk commentedAs 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
Comment #22
yonailo commentedPatch #18 worked for me, subscribing.
Comment #23
Anonymous (not verified) commentedCurrently 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
Comment #24
kentr commentedYes.
#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.
Comment #25
kentr commentedMaking 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).Comment #26
kentr commented#19: I can't recreate this problem. How are your private forums set up?
Comment #27
nzcodarnoc commentedSubscribing
Comment #28
freddyseubert commentedIs this solved in dev? I ran into the same issue with og_forum 2.2...
Comment #29
cleanthes commentedJust to add my voice to this: still an issue with 6.x-2.x-dev (as of today), but the patch appears to work. My setup has two groups, each with their own forum, but when creating a Forum Topic the 'Forum' drop-down was empty. Applied the patch above and it seems to work. I've not done extensive testing yet, though.
Comment #30
Beki commentedsubscribe - but patch worked great :)
Comment #31
boabjohn commentedSorry: patch fails for me on both 6.x-2.2 and x-dev. The x-dev version looks different to what the patch is expecting. Was tempted to hand-edit, but am wondering:
- which version was the patch supposed to be against?
- the -dev version appears to incorporate some elements from the patch, but there's no mention of the patch being rolled into dev (unless I missed it?)
Here's the patch.rej
Thanks for any pointers: I have no forums in my drop downs.
Comment #32
Anonymous (not verified) commentedComment #33
kentr commentedLooks like my patches problematic b/c my editor was converting tabs to spaces and removing whitespace at line endings from the original files. I tested it via command line "patch" on a fresh download.
This patch is made against 6.x-2.x-dev, 2010-Mar-19, where the lines to be changed are 446, 447.
Also tested on 6.x-2.2, where the lines to be changed are 443, 444.
Comment #34
Anonymous (not verified) commented@kentr
If i recall correctly the module previously did work along the lines that are being suggested above but the modifications did not scale very well for sites with large numbers of groups. I would be interested in getting some feedback on performance before committing.
Best,
Paul Booker
Appcoast
Comment #35
kentr commentedMakes sense. Perhaps a config setting so the admin can choose the behavior would help.
The largest concern I had was that clicking the link just failed, leaving the user with no indication of how to make a successful forum post.
I can't offer much relevant feedback on performance. Perhaps one of the others can.
Comment #36
janis_lv commentedhas this been fixed?
users can see, when adding a forum node, taxonomy from groups. forums which are not in groups are not showing up in the menu. but are browsable in from the site.com/forum
using dev version.
Comment #37
aaronbaumanThe patch in #33 does not apply cleanly @ DEV using
patch.When applied manually, it does not solve the issue described herein.
Once I figure out what it's supposed to be doing, I'll post a new patch.
Comment #38
aaronbaumanFor non-group members (including user/1), this issue persists.
From what I can see, there are a few possible solutions:
1. a user with "administer forums" permission can add a forum wherever they please, regardless of og membership
2. a user with "administer organic groups" + "administer forums" should be able to add a forum wherever they please.
3. add an "administer og forums" permission to overcome this issue.
I've rolled one patch for each of the options above, because I'm not sure which one makes the most sense.
Whatever course we agree on, user/1 should not have any restrictions, ever, and all these patches remove those restrictions.
Comment #39
kentr commentedThis issue isn't about adding forums, it's about the visibility of forums as choices in the "Choose a forum" select element when creating a new topic.
Did you mean add a forum type node (aka, "post", "topic", "thread", etc)?
Comment #40
aaronbaumansorry for the miscommunication.
By "a user with 'administer forums' permission can add a forum wherever they please", i mean "a user with 'administer forums' permission can assign a forum to any existing forum vocab term".
In other words, for administrative users the "Choose a forum" menu should not filter any choices -- the patches in #38 accomplish this.
Comment #41
ambereyes commentedOnly one of my groups shows up in the drop down.
I have two groups each with their own forum. The forums are not inside of the same container, they are both at root level.
The first forum, school (gid=116), is listed using url node/add/forum but my second group, staff (gid=122), is not listed. I am a member and a manager of both.
If I use the form "node/add/forum?gids=[]=122" I get nothing in the drop down. Right now members of the second group have no way to post to their forum.
I had previously commented out line 1380 because of problems with #831006: Invalid og_group_context makes Forums inaccessible I could be wrong, but now I am wondering if these two issues are related in some way.
Is there a patch file for the current version, from 2010-11-18, 6.x-2.x-dev? I am not sure what the patches in #38 are for because from the descriptions they do not seem to have anything to do with this issue.
Comment #42
ambereyes commentedAfter some manual fixes to the og_term table, I finally got the second group to be able to post to their forum, but for folks like myself who are members of both groups, it refuses to show me all my forums in a single drop down form node/add/forum ...
To get it to work for the second group, one has to access the forum via node/[gid]/og/forum/[tid] and then click the link to add a forum post. Otherwise it apparently cannot find the second group for context checking.
This is just crazy .... I should be able to use node/add/forum and pick which ever forum I want my post based on all the forums where I have permission.
Edit: to make the gid and tid visible
Comment #43
achandel commentedOne of the issues that Forum taxonomy menu not populated when creating new node is that you have the Taxonomy access permissions" module enabled. If you have this module enabled you will have to set the permissions something like:
anonymous user : Forum#1 View (A) Update(I) Delete (I) Create(Uncheked) List(Checked)
authenticated user :Forum#1 View (A) Update(A) Delete (A) Create(Cheked) List(Checked)
Forum#1 is the taxonomy term of your forum.
Comment #44
vegantriathlete