Skip to content

Fix likes and reposts showing in standard Comments block when other plugins also filter comment types#2981

Draft
pfefferle wants to merge 3 commits intotrunkfrom
fix/comment-query-type-not-in-merge
Draft

Fix likes and reposts showing in standard Comments block when other plugins also filter comment types#2981
pfefferle wants to merge 3 commits intotrunkfrom
fix/comment-query-type-not-in-merge

Conversation

@pfefferle
Copy link
Member

Fixes #2747

Proposed changes:

When another plugin (e.g. Friends, Webmention, Event Bridge) registers a pre_get_comments callback that sets type__not_in, ActivityPub was silently skipping its own exclusion of likes, reposts, and quote comment types. This caused those interactions to appear in the standard WordPress Comments block even when the Fediverse Reactions block was also present on the page.

The fix merges ActivityPub's comment type exclusions with any existing type__not_in values instead of bailing out early when type__not_in is already set.

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  1. Install a plugin that adds custom comment types to type__not_in via pre_get_comments (e.g. Webmention, Friends).
  2. Receive a Like or Repost on a post from the Fediverse.
  3. View that post on the front end with both the standard Comments block and the Fediverse Reactions block present.
  4. Before fix: Likes/Reposts appear in the standard Comments block.
  5. After fix: Likes/Reposts are correctly excluded from the standard Comments block and only appear in the Fediverse Reactions block.

Changelog entry

Significance: Patch, Type: Fixed

Fix likes and reposts appearing in the standard Comments block when another plugin also filters comment types.

… plugin also excludes comment types.

When a plugin like Friends or Webmention set type__not_in on the comment query via
pre_get_comments, ActivityPub silently skipped adding its own exclusions. Merge
the ActivityPub comment types with any existing type__not_in values instead of bailing out.

Fixes #2747
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug/UX] Standard Comments Block displays Likes/Reposts even when "Fediverse Reactions" block is present

1 participant