[wp-trac] [WordPress Trac] #52787: Empty array for non-single post meta breaks post save through REST API

WordPress Trac noreply at wordpress.org
Tue Mar 23 23:35:15 UTC 2021


#52787: Empty array for non-single post meta breaks post save through REST API
-------------------------------------------------+-------------------------
 Reporter:  BrechtVds                            |       Owner:
                                                 |  peterwilsoncc
     Type:  defect (bug)                         |      Status:  closed
 Priority:  high                                 |   Milestone:  5.7.1
Component:  REST API                             |     Version:  5.7
 Severity:  major                                |  Resolution:  fixed
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:  rest-api
  tests commit                                   |
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

 * owner:  (none) => peterwilsoncc
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"50567" 50567]:
 {{{
 #!CommitTicketReference repository="" revision="50567"
 REST API: Prevent database error when deleting meta data.

 Add a check to `WP_REST_Meta_Fields::delete_meta_value()` ensuring meta
 data is set before attempting to delete it from the database. If the data
 does not exist, the delete is considered successful as the data matches
 the desired state.

 Props BrechtVds, goaroundagain, TimothyBlynJacobs.
 Fixes #52787.
 }}}

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


More information about the wp-trac mailing list