When a user is in a forum that is decorated by Advanced Forum, clicking on the "New Topic" button takes the user to the form for creating a new topic. But the "Forum" dropdown in that form isn't set to the forum that the user came from (unless the user came from the "first" forum). My test users often don't notice that they're posting in the wrong forum. I'm assuming this is a bug, since the fact that the tid is in the URL makes it look like the intent was that the "Forum" dropdown is supposed to fill itself in with the forum that the user came from.

If someone is working on this then fine. If not, let me know and I'll try to make a patch.

Comments

troky’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this issue. Can you give me link to problematic forum?

abaihaki’s picture

StatusFileSize
new8.19 KB
new5.5 KB

Hi,
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.

troky’s picture

Well, topic creation isn't part of AF.... it's in core.

dloone’s picture

Yes, 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.

abaihaki’s picture

Status: Postponed (maintainer needs more info) » Fixed

Hi 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!

dloone’s picture

Yeah, 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.