Notes: Fix warning in comment content check - #73198
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.
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.