Make WordPress Core

Opened 5 years ago

Closed 2 years ago

#53622 closed defect (bug) (wontfix)

Query Param status default is a string value, but an array is required

Reported by: austyfrosty Owned by: rachelbaker
Priority: normal Milestone:
Component: REST API Version:
Severity: minor Keywords:
Cc: Focuses: rest-api

Description

Change History (4)

#1 @rachelbaker
4 years ago

  • Keywords needs-patch added
  • Owner set to rachelbaker
  • Status new → accepted

#2 @rachelbaker
4 years ago

  • Keywords needs-unit-tests added

#3 @ironprogrammer
2 years ago

Thanks for the report, @austyfrosty!

Since r39104, the default for status was changed from string to array to support querying multiple post statuses. However, string was/is still supported for backward compatibility.

This suggested change, while making the status param default consistent with the newer expected type, would introduce a backwards compatibility issue. Parts of this controller have been ​copied as-is in userland code, and for example could impact how sanitize_post_statuses() ​assumes the default is a string.

I suggest wontfix on this, though perhaps the code could be documented to indicate this inconsistency.

Props @antonvlasenko and @azaozz for additional in-person discussion.

#4 @ironprogrammer
2 years ago

  • Keywords needs-patch needs-unit-tests removed
  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status accepted → closed

Closing this as wontfix for now, though additional discussion or a documentation update (if helpful) is welcome.

Note: See TracTickets for help on using tickets.