Skip to content

fix the problem with new Guttenberg Inline comments feature#9869

Closed
risto987 wants to merge 2 commits into
WordPress:trunkfrom
risto987:Bug-fix---Gutenberg-Inline-comments-countend-with-default-comments-on-admin-All-Posts-lists-table-issue-#71621
Closed

fix the problem with new Guttenberg Inline comments feature#9869
risto987 wants to merge 2 commits into
WordPress:trunkfrom
risto987:Bug-fix---Gutenberg-Inline-comments-countend-with-default-comments-on-admin-All-Posts-lists-table-issue-#71621

Conversation

@risto987

Copy link
Copy Markdown

Avoid count post editor admin inline comments alongside with user comments

Related issue WordPress/gutenberg#71621

…count post editor admin inline coments alongside with user comments
…mment for compatibility with other comments types
@github-actions

Copy link
Copy Markdown

Hi @risto987! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in the Core Handbook.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

@github-actions

Copy link
Copy Markdown

Trac Ticket Missing

This pull request is missing a link to a Trac ticket. For a contribution to be considered, there must be a corresponding ticket in Trac.

To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. More information about contributing to WordPress on GitHub can be found in the Core Handbook.

@github-actions

github-actions Bot commented Sep 14, 2025

Copy link
Copy Markdown

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 ristojovanovic, adamsilverstein, jeffpaul.

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

@github-actions

Copy link
Copy Markdown

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.

@adamsilverstein

Copy link
Copy Markdown
Member

Hey @risto987 - thanks for the PR!

This did fix the issue in my testing. The red bubbles disappeared, unless I had front end comments awaiting approval.

Since this is a core issue we need a trac ticket for it, can you please open one?

We may also want to consider a way to fix this in Gutenberg directly for users running earlier versions of WordPress. The only way I can think of doing this would be to remove and re-add the comments column using manage_posts_columns and related filters. We can tackle this in a separate PR.

One other nice to have would be a new column for "Editorial Comments" showing resolved/unresolved using the same pattern as the front end approved/pending. This could be added in Gutenberg for now using filters in a separate PR.

@adamsilverstein

Copy link
Copy Markdown
Member

One other nice to have would be a new column for "Editorial Comments" showing resolved/unresolved using the same pattern as the front end approved/pending. This could be added in Gutenberg for now using filters in a separate PR.

Started work on this in WordPress/gutenberg#71622

@jeffpaul

Copy link
Copy Markdown
Member

Since this is a core issue we need a trac ticket for it, can you please open one?

I went ahead and created https://core.trac.wordpress.org/ticket/64012 for this PR.

@risto987

Copy link
Copy Markdown
Author

Hi @adamsilverstein, @jeffpaul,
Thanks to you both for the review and for creating the Trac ticket. I appreciate it.
I'll tackle this Trac ticket.

@adamsilverstein , one more question related to your proposal: should I work on this part as well?

We may also want to consider a way to fix this in Gutenberg directly for users running earlier versions of WordPress. The only way I can think of doing this would be to remove and re-add the comments column using manage_posts_columns and related filters. We can tackle this in a separate PR.

@adamsilverstein

adamsilverstein commented Sep 22, 2025

Copy link
Copy Markdown
Member

@adamsilverstein , one more question related to your proposal: should I work on this part as well?

We may also want to consider a way to fix this in Gutenberg directly for users running earlier versions of WordPress.

I already started work on adding in Gutenberg in WordPress/gutenberg#71622

We probably need another Trac ticket to work on adding the new "Editorial Comments" screen. cc: @jeffpaul

$post_id_in = "'" . implode( "', '", $post_id_array ) . "'";

$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' GROUP BY comment_post_ID", ARRAY_A );
$pending = $wpdb->get_results( "SELECT comment_post_ID, COUNT(comment_ID) as num_comments FROM $wpdb->comments WHERE comment_post_ID IN ( $post_id_in ) AND comment_approved = '0' AND comment_type != 'block_comment' GROUP BY comment_post_ID", ARRAY_A );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks ok for core, although we may be adding additional types so lets hold off until we fine tune the implementation in Gutenberg with a filter.

@t-hamano

Copy link
Copy Markdown
Contributor

Hi @risto987, We are working on implementing the entire Note (formerly known as block comments) feature in #10280. This PR will be included in that new PR,

I'd like to close this PR, but we will record your account as a prop. Thank you for your efforts!

@t-hamano t-hamano closed this Oct 15, 2025
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