Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Replies losing state after edit

cdavidcdavid New
edited November 2010 in Vanilla 2.0 - 2.8
This seems to be a bug, looked at the code only for a short bit, but was not able to trace it down.

How to reproduce:
Write a reply to another comment
Hit the Edit button on that reply. Modify the text and save.

Comment is now not in line any more and has no "Reply" link any more

Expected result:
Comment is still in line and they still can be replied to



  • judgejjudgej
    edited November 2010
    @cdavid Yep, I can confirm that happens for me, and I can give a partial explanation.

    The indenting of the comment is applied using categories, and the indentation level (which determines which categories get applied) are calculated in relation to surrounding comments when the comments are fetched from the database.

    What happens during an edit, is that a single comment is fetched from the database and so it loses its context - it does not know what level it is at, and the classes don't get applied. The comment *is* still attached in the right place (and a screen refresh will confirm that) but is temporarily not indented. There is a new method in plugin that calculates the absolute indentation level for any single comment without the need to fetch any other comments around it, so the intention is to use that on single comments that are returned after an edit.

    I have started with a fix to this, but need to finish that.

    The missing "ReplyTo" link is a strange one, because it *used to* be there, unless I am imagining it. I suspect I am missing an event hook that only fires for individual comment rendering. I think this one will be relatively easy to fix, but I probably won't get to look at it for a few days.
  • No hurry for that. I tried to look at the code and produce some sort of patch, i like the fact that your code is nicely documented, but with all that, I got lost pretty fast.

    Anyway, glad to hear you are working on a fix.

Sign In or Register to comment.