REST API: Cannot send an empty or no-op comment update
|Reported by:||jnylen0||Owned by:||jnylen0|
|Component:||REST API||Keywords:||has-patch has-unit-tests commit fixed-major|
Sending a POST/PUT/PATCH request to /wp/v2/comments/:id fails if the update is empty, or if the comment data is the same as what's currently stored in the database.
This is due to a quirk of wp_update_comment: it returns the number of rows updated by $wpdb->update, which may be zero. However, zero is also used as the return value for an error condition. The API should differentiate between these two states.
For any other object type, sending a "null update" via the API is successful.
Change History (34)
- Keywords 4.8-early added
- Milestone changed from 4.7 to Future Release
- Owner set to rmccue
- Status changed from new to assigned
- Owner changed from rmccue to jnylen0
- Status changed from assigned to accepted
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened