[wp-trac] [WordPress Trac] #42069: Saving metadata fails (randomly) if equal value already exists

WordPress Trac noreply at wordpress.org
Tue Oct 3 07:30:45 UTC 2017


#42069: Saving metadata fails (randomly) if equal value already exists
--------------------------+-----------------------------
 Reporter:  JVel          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  4.8.2
 Severity:  normal        |   Keywords:
  Focuses:  rest-api      |
--------------------------+-----------------------------
 When using js rest api to save page.

 Duplicate value test in wp-includes/rest-api/fields/class-wp-rest-meta-
 fields.php line 303 fails and causes error "Could not update meta value in
 database."


 {{{
 if ( $old_value[0] === $meta_value ) {
 }}}



 Problem seems to be that $old_value is not going through wp_slash but new
 $meta_value is.

 I get it working by changing code to test against $value instead.

 {{{
 if ( $old_value[0] === $value ) {
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42069>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list