Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Comment Delete Button Does Not Work When Admin Editing Comment #1032

Closed eSilverStrike closed 4 years ago

eSilverStrike commented 4 years ago

Admin edits a comment and then clicks on the delete button from the comment editor. It will ask you if you want to delete, you hit yes the page reloads and the comment is not deleted (you may have to refresh the page to see this for some reason)

This only happens for when the Comment Editor is on the Same Page.

If comment editor on it's own page Delete works fine.

eSilverStrike commented 4 years ago

@mystralkk got part of this fixed but now the SEC_checkToken is failing for the delete (only in the one situation with comment edit form on the same page). You must preview the comment edit form first and then try delete and then it fails. Submit comment which also uses the exact same security token does not fail and works fine.

Watching the database during the process of delete I can see the token id change so it looks like on delete only for some reason a submit is happening twice which changes the token in the database before the delete has time to check it. (as I don't see in the code where the security token could change when a delete mode is happening)

Sorry to bug you about this but do you see where this is happening? I must be missing something again.

mystralkk commented 4 years ago

@eSilverStrike , I tried to reproduce the issue, but I sometimes reproduce it and sometimes don't.

eSilverStrike commented 4 years ago

Okay, I will give it another go but may end up leaving it for Geeklog v2.2.2. There is still a number of ways to delete comments so it is not a critical issue. I am thinking it might be a javascript issue that somehow creates a double submit that changes the token.

eSilverStrike commented 4 years ago

Got it figured out :-)