Make WordPress Core

Opened 6 weeks ago

Closed 3 weeks ago

#64474 closed defect (bug) (fixed)

Comments: Notes are accessible when query has comment_type=all

Reported by: wildworks's profile wildworks Owned by: wildworks's profile wildworks
Milestone: 6.9.1 Priority: normal
Severity: normal Version: 6.9
Component: Notes Keywords: has-patch has-unit-tests has-screenshots fixed-major dev-reviewed
Focuses: Cc:

Description

Related: #64198

In the comment list table, notes should not be displayed under any circumstances. However, I discovered that notes are displayed unintentionally when the value of the comment_type argument is all.

Steps to reproduce

  • Create a post.
  • Insert a block and add a note to the block.
  • Access http://localhost:8889/wp-admin/edit-comments.php?comment_type=all.

Change History (31)

This ticket was mentioned in PR #10679 on WordPress/wordpress-develop by @wildworks.


6 weeks ago
#1

  • Keywords has-patch has-unit-tests added

#2 @rollybueno
6 weeks ago

  • Keywords needs-testing added

#3 @rollybueno
6 weeks ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 7.0-alpha-61215-src
  • PHP: 8.2.29
  • Server: nginx/1.29.2
  • Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 142.0.0.0
  • OS: Linux
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Gutenberg 21.7.0
    • Test Reports 1.2.0

Actual Results

  1. ❎ Error condition DID NOT occur. Followed the steps to reproduce on the description but couldn't see it happening on latest trunk.

Additional Notes

  1. Created a new post and added paragraph blocks
  2. Added a note/comment on the paragraph block as per https://wordpress.com/support/wordpress-editor/add-notes-to-blocks/ - it's now labelled as comment as of this writing.
  3. Opened http://localhost:8889/wp-admin/edit-comments.php?comment_status=all as instructed but the exact comment/notes on the paragraph block did not appear.

Supplemental Artifacts

Added comment/notes "THis is a comment/notes?"
https://i.imgur.com/Hpz4Yzw.jpeg

Does not display on edit-comments.php?comment_status=all
https://i.imgur.com/5rGeUOk.jpeg

#4 @westonruter
6 weeks ago

  • Owner set to wildworks
  • Status changed from new to assigned

#5 follow-up: @wildworks
6 weeks ago

❎ Error condition DID NOT occur. Followed the steps to reproduce on the description but couldn't see it happening on latest trunk.

@rollybueno Thanks for the testing, but the URL doesn't seem to be correct. The query argument is comment_type=all, not comment_status=all.

Last edited 6 weeks ago by wildworks (previous) (diff)

#6 in reply to: ↑ 5 @rollybueno
6 weeks ago

Replying to wildworks:

❎ Error condition DID NOT occur. Followed the steps to reproduce on the description but couldn't see it happening on latest trunk.

@rollybueno Thanks for the testing, but the URL doesn't seem to be correct. The query argument is comment_type=all, not comment_status=all.

Thanks @wildworks - I just checked http://localhost:8889/wp-admin/edit-comments.php?comment_type=all but same result. I'll wait on other tester to see if they are able to reproduce this..

#7 follow-up: @wildworks
6 weeks ago

@rollybueno ~What environment are you testing in? From your screenshots, the sidebar UI looks outdated.~

  • Plugins:
    • Gutenberg 21.7.0
    • Test Reports 1.2.0

I found the cause. You're using a slightly outdated Gutenberg plugin. When testing core patches, please don't use the Gutenberg plugin.

Last edited 6 weeks ago by wildworks (previous) (diff)

#8 in reply to: ↑ 7 @rollybueno
6 weeks ago

Replying to wildworks:

@rollybueno What environment are you testing in? From your screenshots, the sidebar UI looks outdated.

@wildworks - I'm using wordpress-develop with latest trunk pull. Just found out that Gutenberg version on my end interferes with this.

After deactivating it, this is how it looks now:
https://i.imgur.com/vlxnJlx.jpeg

So yea, the private comments/notes intended for blocks are visible when visiting http://localhost:8889/wp-admin/edit-comments.php?comment_type=all

#9 follow-up: @rollybueno
6 weeks ago

Visible even with comment_status=all too bdw

#10 in reply to: ↑ 9 @wildworks
6 weeks ago

Replying to rollybueno:

Visible even with comment_status=all too bdw

Do you mean that you checked out the trunk branch, added a comment to a block, and then accessed the URL below?

http://localhost:8889/wp-admin/edit-comments.php?comment_status=all

Does this mean that when you access this URL, the notes are visible? I can't reproduce this in my environment.

#11 follow-up: @Presskopp
6 weeks ago

I'm on 7.0-alpha-61427

on wp-admin/edit-comments.php there are comments only,

on wp-admin/edit-comments.php?comment_type=all there are all comments (comments and notes).

on /wp-admin/edit-comments.php?comment_status=all there are comments only.

whether Gutenberg Plugin (v. 22.3.0) is active or not does not make any difference.

Last edited 6 weeks ago by Presskopp (previous) (diff)

#12 in reply to: ↑ 11 @Presskopp
6 weeks ago

..also confirming that the patch is resoving the issue

Last edited 6 weeks ago by Presskopp (previous) (diff)

#13 @soyebsalar01
6 weeks ago

Confirmed on latest trunk.

Block notes appear only with comment_type=all
Tested the patch it fix the issue.

#14 @r1k0
6 weeks ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.9
  • PHP: 8.3.23
  • Server: Apache/2.4.43 (Unix)
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.3.23)
  • Browser: Firefox 146.0
  • OS: Ubuntu
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Actual Results

  1. ✅ Error condition occurs (reproduced).
  2. Notes are present when user access: wp-admin/edit-comments.php?comment_type=all

Additional Notes

  • None

Supplemental Artifacts

https://i.ibb.co/jkKXXk7M/notes-in-commentlist-before.png

#15 @r1k0
6 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/10679

Environment

  • WordPress: 6.9
  • PHP: 8.3.23
  • Server: Apache/2.4.43 (Unix)
  • Database: mysqli (Server: 8.0.35 / Client: mysqlnd 8.3.23)
  • Browser: Firefox 146.0
  • OS: Ubuntu
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Actual Results

  1. ✅ Issue resolved with patch.
  2. Notes are no longer present in the comment list while accessing: wp-admin/edit-comments.php?comment_type=all

Additional Notes

  • None

Supplemental Artifacts

Before:

https://i.ibb.co/jkKXXk7M/notes-in-commentlist-before.png

After:

https://i.ibb.co/4Z1VZNqg/notes-in-commentlist-after.png

@wildworks commented on PR #10679:


6 weeks ago
#16

@adamsilverstein @desrosj, What do you think about this approach of adding 'type__not_in' => 'note' to the query to make sure the notes never appear in the comments table? When using the WP_Comment_Query class, it is correct behaviour that `note` comment types will be included when `type=all` is requested. However, on the comment table, the note comment type should always be excluded.

@adamsilverstein commented on PR #10679:


6 weeks ago
#17

@adamsilverstein[[Image(chrome-extension://hgomfjikakokcbkjlfgodhklifiplmpg/images/wp-logo.png)]] @desrosj[[Image(chrome-extension://hgomfjikakokcbkjlfgodhklifiplmpg/images/wp-logo.png)]], What do you think about this approach of adding 'type__not_in' => 'note' to the query to make sure the notes never appear in the comments table? When using the WP_Comment_Query class, it is correct behaviour that `note` comment types will be included when `type=all` is requested. However, on the comment table, the note comment type should always be excluded.

Honestly, I'm not sure why we wouldn't allow notes on the comment table. The intent of comment_type=all would seem to be to include notes and any other custom comment type (conceptually, notes still feel like a type of comment for me). Still, developers can filter this out if they choose. All this points to our need to improve comments and comment types overall.

Questions:

  • what happens if you use comment_type=note?
  • how did you find this bug - do we actually link to the comment_type=all url in core or did you manually enter that?

@wildworks commented on PR #10679:


6 weeks ago
#18

what happens if you use comment_type=note?

The parameter is ignored, so the note is not displayed. That's intentional by #10462.

how did you find this bug - do we actually link to the comment_type=all url in core or did you manually enter that?

I manually entered the URL, and I don't think comment_type=all is linked from anywhere.

#19 @ozgursar
5 weeks ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/10679

Environment

  • WordPress: 7.0-alpha-61215-src
  • PHP: 8.2.29
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 143.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Actual Results

  1. ✅ Issue resolved with patch.

Supplemental Artifacts

Before After
https://i.snipboard.io/36dQhC.jpg https://i.snipboard.io/xXbcjL.jpg

@adamsilverstein commented on PR #10679:


5 weeks ago
#20

I manually entered the URL, and I don't think comment_type=all is linked from anywhere.

Given https://github.com/WordPress/wordpress-develop/pull/10462 and the decision to NOT show notes on the comments table, I'm fine making the change proposed in this PR. That said, I'm guessing there will be some need for note management, but perhaps that will remain plugin territory for now.

@wildworks commented on PR #10679:


5 weeks ago
#21

Thanks everyone for your reviews. For now, let's commit this PR and backport it to 6.9.1. We can consider how notes should be displayed in the comments table in a follow-up.

There is also an issue about displaying notes in the post list table: https://github.com/WordPress/gutenberg/issues/71622

#22 @SirLouen
5 weeks ago

  • Keywords has-screenshots added; needs-testing removed

@wildworks commented on PR #10679:


5 weeks ago
#23

it would be helpful to add a test case that also includes a custom comment type to ensure that comment_type=all does display that and continues to ignore the note

Nice idea, updated the test in 5941650cfbc674e7373e6a843cbb78addbfd53c1

This ticket was mentioned in Slack in #core by jorbin. View the logs.


4 weeks ago

@wildworks commented on PR #10679:


3 weeks ago
#25

I think all the feedback has been addressed, so I’d like to commit this patch.

#26 @wildworks
3 weeks ago

  • Keywords commit added

#27 @wildworks
3 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 61525:

Comments: Explicitly exclude note comment type on the comments table.

Fix an issue where adding comment_type=all as a query parameter to the wp-admin/edit-comments.php page would unexpectedly cause notes to show.

Follow-up to [61183].

Props adamsilverstein, jorbin, mukesh27, ozgursar, Presskopp, r1k0, rollybueno, soyebsalar01, westonruter, wildworks.
Fixes #64474.

#28 @wildworks
3 weeks ago

  • Keywords dev-feedback added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening #64474 to request backporting [61525] to the 6.9 branch

#29 @wildworks
3 weeks ago

  • Keywords commit removed

#30 @jorbin
3 weeks ago

  • Keywords fixed-major dev-reviewed added; dev-feedback removed

[61525] is good for backport to 6.9 branch.

#31 @wildworks
3 weeks ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 61535:

Comments: Explicitly exclude note comment type on the comments table.

Fix an issue where adding comment_type=all as a query parameter to the wp-admin/edit-comments.php page would unexpectedly cause notes to show.

Follow-up to [61183].

Reviewed by jorbin.
Merges [61525] to the 6.9 branch.

Props adamsilverstein, jorbin, mukesh27, ozgursar, Presskopp, r1k0, rollybueno, soyebsalar01, westonruter, wildworks.
Fixes #64474.

Note: See TracTickets for help on using tickets.