• Resolved tetrakern

    (@tetrakern)


    Hello,

    I got a problem with the commenting since I modified the comment system in my theme via the default WP hooks and functions. So no plugin here.

    When I post a comment (as guest), the comment section is completely broken. The form is wrong (even shows a checkbox that I removed via filter) and the comments… I can’t even tell what is happening there. The HTML is there when I inspect the site, it’s just that everything is out of place and invisible regardless. See images because there is no way to properly describe that.

    Images:
    Comment form before commenting.
    Comment section after commenting.
    Comment section after simply reloading. (How it’s supposed to look like.)

    I tried turning the comment form ESI on and off, to no avail. Caching commenters did nothing. The URL does have a query parameter after commenting (commentcode) that is used to display the comment if not yet approved but I cannot see why this should matter in this case, so just fyi.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    please provide the report number

    you can get it in toolbox -> report -> click “send to LiteSpeed”

    Best regards,

    Thread Starter tetrakern

    (@tetrakern)

    Here you go: ZLUYSEQZ

    Plugin Support qtwrk

    (@qtwrk)

    could you please try turn off ESI , purge all , and see how it behaves ?

    Thread Starter tetrakern

    (@tetrakern)

    To probably nobody’s surprise, this does indeed fix the issue. Although I would really like to serve public caches to logged-in users or I could have saved myself all the AJAX.

    Thread Starter tetrakern

    (@tetrakern)

    I find the “resolved” a bit overeager considering that I had to disable a feature to avoid an error, but okay.

    I did indeed actually resolve the issue now and made ESI work. So what was wrong? Two things, one is on me… the other is open for debate.

    I modified the comments in the template instead of the hooks. So when the site was cached, this was not executed and therefore fell back to the default. Partially. It’s weird since the HTML was there, just not rendered, but moving everything into hooks solved that one. Good enough.

    The other was… most likely due to WordPress itself. I did not find the precise location in the code (and wasn’t all that motivated to search), but I suspect that somewhere after the default form fields filter, the default fields get merged in. And since I unset the cookies field, this was then reset. I don’t know why this only happened while using ESI and not all the time as one would expect, but just setting the cookies field to an empty string instead of removing it completely resolved this issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Comment section broken after commenting until reload’ is closed to new replies.