[wp-trac] [WordPress Trac] #63420: update_metadata issue when checking $wpdb->update result

WordPress Trac noreply at wordpress.org
Fri May 9 01:06:16 UTC 2025


#63420: update_metadata issue when checking $wpdb->update result
--------------------------------+---------------------------------------
 Reporter:  gdogabriel          |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:  trunk
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:  administration, rest-api
--------------------------------+---------------------------------------

Comment (by gdogabriel):

 In my case, I found that I have duplicate meta_keys in my local
 installation. This is preventing to detect when the value is the same,
 since count( $old_value ) should be identical to 1.


 ||= post_id =||= meta_key =||= meta_value =||
 || 123 || footnotes || [{"id":"8a067ad3-...","content":""}] ||
 || 123 || footnotes || [{"id":"8a067ad3-...","content":""}] ||

 {{{#!php
 <?php
                 if ( is_array( $old_value ) && 1 === count( $old_value )
                         && $this->is_meta_value_same_as_stored_value(
 $meta_key, $subtype, $old_value[0], $value )
                 ) {
                         return true;
                 }
 }}}

 For some reason, I have several pages with duplicate footnotes and other
 metadata, including _edit_last, _wp_page_template, and metadata from other
 plugins.

 Deduplicating metas solves it in my case.

 So this may not be an issue to be resolved here. Perhaps this information
 will be useful to anyone having the same problem.

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


More information about the wp-trac mailing list