[wp-trac] [WordPress Trac] #55617: /wp/v2/pattern-directory/patterns endpoint: slug parameter has no effect on the response

WordPress Trac noreply at wordpress.org
Mon May 2 13:59:04 UTC 2022


#55617: /wp/v2/pattern-directory/patterns endpoint: slug parameter has no effect on
the response
---------------------------------------------+-----------------------------
 Reporter:  antonvlasenko                    |       Owner:  hellofromTonya
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  6.0
Component:  REST API                         |     Version:  trunk
 Severity:  major                            |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  rest-api
---------------------------------------------+-----------------------------
Changes (by hellofromTonya):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"53333" 53333]:
 {{{
 #!CommitTicketReference repository="" revision="53333"
 REST API: Fixes `/wp/v2/pattern-directory/patterns` endpoint response for
 `slug` parameter.

 [53218] introduced a bug of a wrong response from the `wp/v2/pattern-
 directory/patterns` endpoint with a `slug` parameter. As the response is
 cached, it can result in an incorrect list of available patterns supported
 by the current theme.

 This commit resolves by:

 * Limiting the `slug` to an `array` in the query parameters.
 * When set, parsing and sorting the slug(s) and then serializing the
 sorted query args as part of the hashed transient keys.

 Props antonvlasenko, timothyblynjacobs, spacedmonkey, costdev,
 hellofromTonya.

 Follow-up to [53218], [53152], [51208].
 Fixes #55617.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55617#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list