Skip to content

Conversation

@adamsilverstein
Copy link
Member

@adamsilverstein adamsilverstein commented Oct 25, 2025

Trac ticket: https://core.trac.wordpress.org/ticket/64152


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@adamsilverstein adamsilverstein marked this pull request as ready for review October 25, 2025 19:37
@github-actions
Copy link

github-actions bot commented Oct 25, 2025

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props adamsilverstein, westonruter, mamaduka, kadamwhite.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@Mamaduka
Copy link
Member

Would also include the patch from WordPress/gutenberg#72561 here. I was planning to create a sync PR, but I think it makes sense to do it here.

array(
'count' => true,
'orderby' => 'none',
'type' => $comment->comment_type,
Copy link
Member

@westonruter westonruter Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a type is not provided, doesn't it mean all? I'm surprised that the it wasn't returning the note children already.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is required after #10405, where note type will be intentionally excluded.

Copy link
Member Author

@adamsilverstein adamsilverstein Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~Even before #10405 the test in this pr fails without the controller change on trunk. ~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the wording of #10405 it looks like all really does mean all, and would include Notes. Shouldn't we use that, then?

If we always assume the children will share type, is there a risk that this could cause unexpected behavior if you have a system where multiple comment types are structured together in a hierarchy, such as for example,

-+- Parent comment
 +- Child comment
 +- Custom Emoji reaction comment type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will test using 'all'. Until the other pr merges, not providing a type should imply 'all' though. I can see how this could break certain mixed type parent/children use cases, although developers could likely filter around that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even before #10405 the test in this pr fails without the controller change on trunk.

Turns out I did have that code active, thats why the tests were failing. After #10405, 'all' will be required here. I'll sync these changes over to that PR to make it clearer.

Copy link
Contributor

@kadamwhite kadamwhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broadly, this is working for me in the simple case and makes logical sense for our uses. I do have one question about whether we'd need to support checking for children across types in other scenarios

array(
'count' => true,
'orderby' => 'none',
'type' => $comment->comment_type,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the wording of #10405 it looks like all really does mean all, and would include Notes. Shouldn't we use that, then?

If we always assume the children will share type, is there a risk that this could cause unexpected behavior if you have a system where multiple comment types are structured together in a hierarchy, such as for example,

-+- Parent comment
 +- Child comment
 +- Custom Emoji reaction comment type

@adamsilverstein
Copy link
Member Author

I am closing this ticket in favor of #10405 - I moved the fix and unit test over to that PR since the issue being fixed is introduced in that PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants