Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#38720 closed defect (bug) (fixed)

REST API: Updating a comment without sending content is valid, but unsupported

Reported by: jnylen0's profile jnylen0 Owned by: joehoyle's profile joehoyle
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

The REST API currently prohibits updating a comment unless the content is specified along with the update. Originally introduced here (and then shuffled around a bit afterwards).

This doesn't make sense with the rest of the API: it's possible (and common) to update only a couple of attributes at a time for a post.

Example use cases:

  • Fixing a typo in the author name
  • Resetting the parent of a comment if it was placed incorrectly on a p2

Attachments (4)

38720.diff (2.9 KB) - added by jnylen0 8 years ago.
38720.2.diff (5.7 KB) - added by jnylen0 8 years ago.
We still want to prohibit comment updates with content: ''.
38720.3.diff (5.5 KB) - added by jnylen0 8 years ago.
Let's also not change the error responses for no reason.
38720.4.diff (4.3 KB) - added by jnylen0 8 years ago.
Aaaand... let's not add unnecessary tests either.

Download all attachments as: .zip

Change History (9)

@jnylen0
8 years ago

#1 @jnylen0
8 years ago

  • Keywords has-patch has-unit-tests added

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


8 years ago

#3 @jnylen0
8 years ago

  • Milestone changed from Awaiting Review to 4.7

This ticket was mentioned in Slack in #core-restapi by jnylen. View the logs.


8 years ago

@jnylen0
8 years ago

We still want to prohibit comment updates with content: ''.

@jnylen0
8 years ago

Let's also not change the error responses for no reason.

@jnylen0
8 years ago

Aaaand... let's not add unnecessary tests either.

#5 @joehoyle
8 years ago

  • Owner set to joehoyle
  • Resolution set to fixed
  • Status changed from new to closed

In 39196:

REST API: Allow updating a comment without the content present.

For all resources in the REST API, sending partial updates is supported. This fixes needing to _always_ specify comment content.

Props jnylen.
Fixes #38720.

Note: See TracTickets for help on using tickets.