Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#38975 closed enhancement (fixed)

REST API: Add tests for empty or "no-op" updates

Reported by: jnylen0 Owned by: jnylen0
Priority: normal Milestone: 4.7
Component: REST API Version: 4.7
Severity: normal Keywords: has-unit-tests commit dev-reviewed
Cc: Focuses:

Description

"Empty" updates that don't change any stored values should be allowed for all resource types. This patch adds tests accordingly for posts, terms, and users.

This is currently broken for comments. See ticket:38700#comment:14 for details.

Attachments (1)

38975.diff​ (3.8 KB ) - added by jnylen0 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 @joehoyle
10 years ago

Given we also have the test for comments in #38700, maybe we should remove it from this patch, and then we can commit.

#2 @pento
10 years ago

  • Keywords commit dev-reviewed added
  • Owner set to jnylen0
  • Status new → assigned

#3 @jnylen0
10 years ago

  • Resolution → fixed
  • Status assigned → closed

In 39371:

REST API: Add tests for empty or "no-op" updates.

The API should allow updates that don't actually change anything. This allows
clients to, for example, accidentally send the same request twice without
encountering unexpected errors. This currently works for posts, terms, and
users, so this commit adds test cases accordingly.

See #38700 for issues preventing this from working for comments.

Fixes #38975.

#4 @pento
10 years ago

In 39372:

REST API: Add tests for empty or "no-op" updates.

The API should allow updates that don't actually change anything. This allows clients to, for example, accidentally send the same request twice without encountering unexpected errors. This currently works for posts, terms, and users, so this commit adds test cases accordingly.

See #38700 for issues preventing this from working for comments.

Merge of [39371] to the 4.7 branch.

Props jnylen0.
See #38975.

Note: See TracTickets for help on using tickets.