• I’ve tested this on several websites and it appears this happened after updating to WP 5.1.

    Replying to comments no longer works. When replying to a comment, it is impossible to write anything in the message textarea. Posting a comment works though. This is only an issue when replying to comment.

    Does anyone else has this problem?

    Thank you for your time!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there, I’ve just noticed this as someone pointed it out to me on my site.
    How to fix it is beyond me, but I tried a bit of troubleshooting and the browser console appears to throw an error when hitting the reply button:

    TypeError: t.I is not a function

    The specific line in the code that it refers to is #7:

    comm = t.I( commId ),

    Jim

    (@digitalredefined)

    I’ve got a client who is experiencing the same issue. Running on WP 5.1 as well. Errors are the same as @triplezerox mentioned.

    I’d like to present a potential solution that I put together after doing some further research and testing. I’ve confirmed that this fixes things on my site.

    This appears to have been resolved already in an update of WordPress 5.1:
    https://core.trac.www.ads-software.com/ticket/46260

    However, if you go into the directory of the plugin’s js folder:
    <website root>/wp-content/plugins/tinymce-comment-field/js/

    You should notice that there’s a file called “comment-reply-4.8.0.js”. This appears to be a copy of the comment-reply.js file from version 4.8 of WordPress, and the reason why the plugin is not working as it should.

    To resolve the issue, I simply copied the new version of the file into the directory, named the old one “comment-reply-4.8.0.js.bak” just in case, and then named the new one “comment-reply-4.8.0.js”. WordPress keeps the current version in:
    <website root>/wp-includes/js/

    Jim

    (@digitalredefined)

    Thanks for the tip. Doing this is now displaying the editor under the comment you’re replying to however it won’t let you enter any text

    • This reply was modified 5 years, 6 months ago by Jim.

    It may be worth trying this code which goes into your theme’s functions.php file:

    global $wp_version;
    if (version_compare($wp_version, '5.1.1', '>=')) {
        add_filter('comment_reply_link', 'haremu_replace_comment_reply_link', 10, 4);
        function haremu_replace_comment_reply_link($link, $args, $comment, $post)
        {
            if (get_option('comment_registration') && !is_user_logged_in()) {
                $link = sprintf(
                    '<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
                    esc_url(wp_login_url(get_permalink())),
                    $args['login_text']
                );
            } else {
                $onclick = sprintf(
                    'return addComment.moveForm( "%1$s-%2$s", "%2$s", "%3$s", "%4$s" )',
                    $args['add_below'],
                    $comment->comment_ID,
                    $args['respond_id'],
                    $post->ID
                );
                $link = sprintf(
                    "<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s' aria-label='%s'>%s</a>",
                    esc_url(add_query_arg('replytocom', $comment->comment_ID, get_permalink($post->ID))) . "#" . $args['respond_id'],
                    $onclick,
                    esc_attr(sprintf($args['reply_to_text'], $comment->comment_author)),
                    $args['reply_text']
                );
            }
            return $link;
        }
    }

    Disclaimer: Not my work. Retrieved from https://haremu.com/p/527

    I used it for a separate issue when I couldn’t get comment data to POST – you’d click ‘submit’ and nothing would happen. It seems WordPress 5.1 changed the way this works, and this fixes it.

    Well, @triplezerox , I just want to thank you VERY MUCH for your two answers !
    (Sorry for my english I’m french… ?? ).
    Same issue here and your solution fixed it : copy comment-reply.js file from wp-includes/js/ to wp-content/plugins/tinymce-comment-field/js/ , re-named the old one “comment-reply-4.8.0.js.bak”, just for fun re-named the new one “comment-reply-5.2.2.js” : it works, but, same as @digitalredefined , editor appears under the comment but impossible to enter some text.
    Then I copy your code in my theme functions.php file and it works.
    It stays a little issue : on the answer, the link “cancel the answer” is not working, the author have to refresh the view to leave ; but it’s a lesser evil…
    Thank’s again, anyway !
    I hope the author of this plugin, otherwise excellent, will be able to fix it in the next version…

    Copying wp-includes/js/comment-reply.js is useless.

    It looks like t.I is just an alias for document.getElementById. Just replace the line 6 in comment-reply-4.8.0.js by this line:
    t = this; t.I = function(id) { return document.getElementById(id); };

    In my case, this + the haremu fix = everything works fine.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Reply to comments no longer works’ is closed to new replies.