Skip to:
Content
Pages
Categories
Search
Top
Bottom

Threaded Replies – Still not working


  • WorldWideWebb
    Participant

    @worldwidewebb

    Seen this one come up a few times in this forum, but have yet to see a fix. Hopefully the following additional details help to diagnose the threaded replies not working very well:

    – It is not a conflict with my theme (I switched to 2019 and disabled all plugins).

    – The issue does not occur when I am logged in as an administrator (nested/threaded replies work fine if I’m logged in with my admin account) or when all other plugins are disabled.

    – Re-enabling WooCommerce makes the issue come back (so that suggests that there is some interaction with WC that is causing this).

    – When the issue is present, the reply form briefly appears where it’s supposed to (directly below the reply that I am replying to), but the page then redirects to the same page with querystring parameters appended to the URL. Example: mysite.com/topic/the-topic-title/?bbp_reply_to=7330&_wpnonce=bb385daa6e#new-post

    – Also when the issue is present, I see the following js errors in the console when I hit reply:

    “TypeError: event.target.matches is not a function” – touch-keyboard-navigation.js:277:22
    “TypeError: d is null” – reply.min.js:3:997 (appears to have to do with scrolling, probably what’s in charge of scrolling the page down to the reply form)

    I’m guessing that maybe this redirection should be disabled somewhere? I can’t interrupt it to test out whether the reply would work correctly if the page didn’t redirect me first.

    Since WooCommerce is such a common plugin, I’m hoping this issue can be addressed.

Viewing 8 replies - 1 through 8 (of 8 total)

  • WorldWideWebb
    Participant

    @worldwidewebb

    Was able to catch the page before the redirect (quick mouse work to hit stop before the page refreshed). The reply seemed to work correctly when I did that – the form appeared the right place, I hit stop to prevent the refresh, filled out a reply and submitted, and it worked.

    So question is why is this happening with WC activated, and how do we fix?


    WorldWideWebb
    Participant

    @worldwidewebb

    OK – implemented a fix that seems to be working (time will tell). Hope this helps someone else:

    The issue was indeed the redirect that happens when you click the reply links. The fix was to trap the default behavior of those links (using preventDefault so that the link is not followed), so added that to the link output. In the following file on line 1612:

    bbpress/includes/replies/template.php

    Change the line to this:

    $onclick = ' onclick="event.preventDefault(); return addReply.moveForm(\'' . implode( "','", $move_form ) . '\');"';


    Robin W
    Moderator

    @robin-w


    HoCh
    Participant

    @hoch

    Hey there
    Thank you very much for your suggested solution. So far no success on our forum (https://zeitgut-zuerich.ch/forums/thema/nachbarschaftliche-unterstuetzung/). Do I need to do anything else after I changed ./template.php?

    I realised meanwhile that the reply form opens where it should (i.e. right under the reply in want to write a reply to) when I click a second time on REPLY which is – obviously – very inconvenient.

    I really would need a working forum since we need it for our neighbourhood assistance to coordinate help during the coronavirus lockdown here in Zurich (Switzerland).

    Related: https://bbpress.org/forums/topic/threaded-replies-not-working-urgent/


    HoCh
    Participant

    @hoch

    Hello again
    Finally it seems to work. Thanks for your solution.


    Robin W
    Moderator

    @robin-w

    great – suspect it was a caching issue and your browser just needed refreshing


    levangelista2013
    Participant

    @levangelista2013

    Same problem: not possibile to replay to a replay. I get a message saying (I translate from Italian) ‘you don’t have the permissions. the variable does not match’. As I am unable to deal with the code, I will use a different plugin.


    AndyHenderson
    Participant

    @andyhenderson

    Thanks for spotting that. I’d assumed it was something I had done to disrupt BBPress but I hadn’t spotted the page was being refreshed and that it cleared the Javascript error from the console.

    Until the issue is fixed, a better work-around is to add a filter to functions.php rather than modify the BBPress code directly. That way the fix should survive a BBPress update. I used…

    // Prevent reply button in forums from executing a refresh of the page
    add_filter('bbp_get_reply_to_link', 'ctcFixReplyToLink', 10, 3);
      function ctcFixReplyToLink( $link, $r, $args ) {
        return str_ireplace( '"return addReply', '"event.preventDefault(); return addReply', $link );
      }
Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar