Limited Support
Our team is currently on holiday, so support will be limited during this period. Response times may be slower than usual, and some inquiries may be delayed.
We appreciate your patience and understanding, and we’ll resume our usual support by the end of August.
Hi. I experienced the same problem yesterday, where a reader not admin, not even connected saw a comment which wasn't yet approved (and wasn't their's).
A staff member managed to recreate the issue while not connected, though we can't recreate it anymore. there was over 80 comments at the time the issue occured.
A clear of comment cache might have removed the problem
"Use Wordpress native Ajax functions" is unchecked
Cache is enabled
he is the link to the post Une professeure obtient la suspension de sa mutation à Paris
Thanks for your help.
Hi,
This should be a cache issue. Please disable all kinds of cache systems and check again.
Hi. Disabling any and all caches on a live service to detect a transient issue isn't feasible on our infrastructure.
Instead here is possibly the source of the issue:
in /utils/class.WpdiscuzHelper.php :
public function isUnapprovedInTree($comments) { foreach ($comments as $comment) { if ($comment->comment_approved === "0") { return true; } if ($children = $comment->get_children()) { return $this->isUnapprovedInTree($children); } } return false; }
This function is used to determine if comments are cacheable but contains a logic mistake, where if an "approved branch" is read first, the function skips the rest of the tree returning false.
one way to fix this issue in the code would be:
public function isUnapprovedInTree($comments) { foreach ($comments as $comment) { if ($comment->comment_approved === "0") { return true; } if ($children = $comment->get_children()) { if($this->isUnapprovedInTree($children)){ return true; } } } return false; }
the difference being: if an unapproved leaf is found, we can say for sure the whole contains unapproved comment, but otherwise we still need to check the rest of the tree.
i could not reproduce it, but here is the next best thing i found:
cd [path-wpdiscuz-cache]/cache/comments/ && grep -ari 's:16:"comment_approved";s:1:"0";'
returning elements, ie unapproved comment in the cache maintained by wpdiscuz.
As a last note: this might not be the only source of this peculiar issue, just the one i found.