64049: REST API: Allow comments to be edited to become empty#10083
64049: REST API: Allow comments to be edited to become empty#10083kadamwhite wants to merge 7 commits intoWordPress:trunkfrom
Conversation
…-rest-empty-comment-updates
…comment object Permits patch updates which modify non-content values without incorrectly failing a partial object for having "empty" content
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Originally proposed by @adamsilverstein in #9988, this PR adds tests to his fix while also resolving a potential logical error which could prevent updates to unrelated comment object properties.
Undefined array key "comment_content"(failing on the last line ofcheck_is_comment_content_allowed) because the controller expects to be able to process partial objects: For example, you can pass an object in a PUT which changes the author but alters no other fields.check_is_comment_content_allowed()can be called is during the create_item method, which ensurescomment_contentis initialized to''if not present — this should not result in any change to existing behavior on comment creation or updates.Trac ticket: https://core.trac.wordpress.org/ticket/64049
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.