Support » Themes and Templates » comment-reply.js breaks makes comment_parent value always 0

  • Resolved Salvatore Formisano


    Hi all,

    I’ll start by saying that I experimented a lot before posting. I guarantee that comment-reply.js is properly included, as proof clicking on the ‘reply’ link moves the form right under the comment I want to answer to.

    The problem: when js is on, if I try to reply to a comment, the new comment will still have a comment_parent value of 0, hence making it a new comment and not an answer.

    My attempts:
    1) removing all javascripts and deactivating all plugins leaving JUST comment-reply.js – result, still broken
    2) Deactivating javascript completely, WORKS
    3) Manually changing comment_parent value input trough firebug – if JS is on still no luck.

    So basically, when js is on and comment-reply.js is included, I get the nice form moving around thing, but then comment_parent breaks.

    Mind this, I checked with web dev tools on chrome and firebug on firefox, the comment_parent input DOES GET UPDATED with the parent it. So you would see that input being updated every time you hit a reply link.

    Simply said, on submission, once we reach /wp/wp-comments-post.php $_POST[‘comment_parent’] has suddenly become a 0.

    I logged the whole $_POST many times at the top of the file to know just what comes out of the form. When js is off or comment-reply.js is excluded, all working. When comment-reply.js is running, comment_parent == 0.

    Rings any bells? Is this a known issue?

    Thanks so much, this took the last 3 hours of my life and I got nowhere yet.

Viewing 1 replies (of 1 total)
  • Just in case anyone ever stumbles into a similar problem, I was using the ‘comment_form’ function with my own defined fields.

    I had then attached the output of the get_comment_id_fields() function to comment_field. I had read that in order to make threaded comments work you had to manually add this output. Turns out wordpress attaches those fields by itself without the need for you to add them to a different field.

    I hope this will save someone some time

Viewing 1 replies (of 1 total)
  • The topic ‘comment-reply.js breaks makes comment_parent value always 0’ is closed to new replies.