-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Notes: Fix warning in comment content check #73198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
| * comment_content. See wp_handle_comment_submission(). | ||
| */ | ||
| return '' !== $check['comment_content']; | ||
| return ! isset( $check['comment_content'] ) || '' !== $check['comment_content']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes behavior described in comment, but it doesn't affect anything actual.
b1abba3 to
3a3d008
Compare
|
I just realized this doesn't require fix in core. Props to @kadamwhite - Mamaduka/wordpress-develop@1c9e7ef. I'll create track ticket for "::update_item has special check for when only comment status is changed" Here's the ticket - https://core.trac.wordpress.org/ticket/64248#ticket. |
What?
Part of #73141.
PR tries to fix warning triggered by
check_is_comment_content_allowedcall inside the::update_itemcontroller method. The warning is logged when the note is resolved or reopened.This doesn't look like a new issue, it just more visible with Notes.
Why?
Users can sent partial data when updating a comment/note, this includes omitting the content. The
::update_itemshould account for this.::create_itemsets content value to empty string when it's not included in the request. We can't do this when updating the item.::update_itemhas special check for when only comment status is changed, that code path never runs. The$prepared_argsalways includes fallback values for user ID and agent. I would like to fix this separately, will create the trac ticket.Testing Instructions
Testing Instructions for Keyboard
Same.