Fixed  Closed forum phrase bug

SchmitzIT

Well-known member
I just tested posting to a closed forum, and see the following error:


may_not_perform_this_action_because_forum_does_not_allow_posting
There is a phrase called: you_may_not_perform_this_action_because_forum_does_not_allow_posting
I am guessing that is what was intended to be shown. So just a minor typo, but a typo nonetheless ;)
 

Attachments

  • closed_forum_error.webp
    closed_forum_error.webp
    6.7 KB · Views: 4
Actually, while my files upload, I checked the code. For a post in a closed forum, the phrase is correct. It's in threads.php in 1.0.0 the phrase is wrong.

Line 628 - 632
Code:
        if (empty($forum['allow_posting']))
        {
            $errorPhraseKey = 'may_not_perform_this_action_because_forum_does_not_allow_posting';
            return false;
        }

and line 939-943:
Code:
        if (empty($forum['allow_posting']))
        {
            $errorPhraseKey = 'may_not_perform_this_action_because_forum_does_not_allow_posting';
            return false;
        }

I'll revert if the problem is gone in 1.0.1.
 
This is not fixed in 1.0.1.

However, it has a fairly obscure recreation path. I'm in the middle of documenting a few things concerning the Node Tree, and created a forum that way. I run a seocnd browser where I am logged in as a regular user. I created a thread with that regular user, and posted it. Then in the first browser, I set the node to not allow new messages.

Switched back to the second browser, where the reply button then still is visible. Tried to post a reply, and then see the above behaviour. If I totally refresh my browser, the forum will correctly state I have insufficient priviledges to post, rather than offering a reply button.

To confirm, use two browsers, and ensure the setting is set to be open for posting when you load the regular user window. Once done, CTRL + F5 to flush browser cache. Reply button will become visible. Switch back to admin window, and turn off option to allow posting.

Switch back to regular user browser, and attempt to reply.
 
Odd. I just checked the 1.0.1 version of threads.php (in Library/XenForo/Model, and the lines indicated above are still the same. The bug should still exist. Just odd you see a different message than I do.
 
I have fixed this now. I think the confusion is that creating a thread is fine; it's only replying to a thread that was broken (well, and voting on a poll).
 
Top Bottom