Closed (fixed)
Project:
Advanced Forum
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jun 2011 at 05:21 UTC
Updated:
6 Jul 2011 at 11:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
troky commentedI can't reproduce this issue. Can you give me link to problematic forum?
Comment #2
abaihaki commentedHi,
I'm using version 6 and have the same problem. Just wondering if there's any other related permissions I should take care of to make this work.
I've attached 2 images here. First one is the topic node form for general forum user (showing no Forums option).
The second one is the topic node edit form opened by a forum admin (with permissions to administer forum) after posting by the general user above. It shows the drop down menu "Forums" but it doesn't choose automatically which forum it is despite the 'new topic' button was clicked on a specific forum.
Comment #3
troky commentedWell, topic creation isn't part of AF.... it's in core.
Comment #4
dloone commentedYes, I started looking into it and found that it's in core. It looks like forum_form_alter receives a form that already has a #default_value for the dropdown (haven't figured out why yet, but it seems to always be a value that points to the first forum in the dropdown), and the logic of that function uses the value from the URL only if there isn't a a pre-existing value in the form. My inexperienced (at Drupal) eye would have expected it to use the value from the URL as an override to whatever was already in the form, so that logic seems the wrong way around. If I change the logic to do that then it seems to work.
Comment #5
abaihaki commentedHi everyone,
Thanks for taking the time to answer the question. I knew there's something wrong with the core. What I did was to re-install the Forum and Taxonomy modules and now it shows up.
Since dloone (original poster) also found a solution, I think we can close this issue.
Thanks again!
Comment #6
dloone commentedYeah, apologies for raising the issue here without first investigating properly. The code comment in forum_form_alter makes it clear that the intent of the logic is to use the TID form the URL only if there isn't already a #default_value in the form (which seems the wrong way around to me, but there's probably a reason that isn't obvious to me). I'll have to do some more work to figure out where that #default_value in the form is coming from when I get some time to do a clean install and test it properly. In the meantime, I've just created a hook_form_alter in my site module that thumps the #default_value whenever it finds a TID in the URL, which gets me going in the short term.