WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#38975 closed enhancement (fixed)

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

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

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 5 months ago.

Download all attachments as: .zip

Change History (5)

@jnylen0
5 months ago

#1 @joehoyle
5 months 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
5 months ago

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

#3 @jnylen0
5 months ago

  • Resolution set to fixed
  • Status changed from assigned to 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
5 months 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.