Fix comment moderation sorting with missing meta#538
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #538 +/- ##
=============================================
+ Coverage 70.72% 70.88% +0.16%
Complexity 1144 1144
=============================================
Files 67 67
Lines 5510 5530 +20
=============================================
+ Hits 3897 3920 +23
+ Misses 1613 1610 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What?
Follow up to #518.
Fixes Comment Moderation sorting so comments without AI moderation metadata stay visible when sorting by Sentiment or Toxicity.
Why?
The comments list can include both analyzed and unanalyzed comments. Before this change, sorting by Sentiment or Toxicity used
meta_keysorting, which only returns comments that have that meta key. As a result, unanalyzed comments disappeared from the list even though the total item count still included them.How?
meta_queryclauses for comments with and without moderation metadata.Use of AI Tools
AI assistance: Yes
Tool(s): ChatGPT / Codex
Used for: Helping inspect the repository, draft and iterate on the patch, run local verification commands, and review the PR description. I manually reviewed the implementation, validated the behavior locally, and verified the final test results before submitting.
Testing Instructions
wp-admin/edit-comments.php.composer run-script test composer run-script lint composer run-script phpstanScreenshots or screencast
Not applicable. This fixes list table sorting behavior and is covered by integration tests.
Changelog Entry