Make WordPress Core

Opened 4 months ago

Last modified 6 weeks ago

#64248 new defect (bug)

REST API: Logic to only change comment status never runs

Reported by: mamaduka's profile Mamaduka Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: needs-unit-tests has-patch
Focuses: Cc:

Description

The ::update_item method has special condition for when only comment status is changed, that code path never runs. The $prepared_args always includes fallback values for user IP and agent.

Attachments (1)

64248.diff (229.6 KB) - added by heetwp 6 weeks ago.

Download all attachments as: .zip

Change History (4)

#1 @swissspidy
4 months ago

  • Keywords needs-patch needs-unit-tests added
  • Version set to 4.7

The 127.0.0.1 fallback was added in #38819. There's definitely a gap in test coverage for this part of the code.

#2 @heetwp
7 weeks ago

I’d like to work on this and will submit a patch soon.

@heetwp
6 weeks ago

#3 @heetwp
6 weeks ago

  • Keywords has-patch added; needs-patch removed

Patch attached. Fixes REST API logic where status-only comment updates never ran. Includes unit test. Tested locally.

Note: See TracTickets for help on using tickets.