[wp-trac] [WordPress Trac] #55467: WP_REST_Meta_Fields::update_meta_value handles update_metadata return value incorrectly
WordPress Trac
noreply at wordpress.org
Sat Mar 26 18:13:11 UTC 2022
#55467: WP_REST_Meta_Fields::update_meta_value handles update_metadata return value
incorrectly
---------------------------+-----------------------------
Reporter: wordpressscyt | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.9
Severity: normal | Keywords:
Focuses: |
---------------------------+-----------------------------
In the WP_REST_Meta_Fields::update_meta_value method the update_metadata
function is used and handles every "false" return value from this function
as an error.
See https://github.com/WordPress/wordpress-
develop/blob/0b800e21c311e302824e4a025946a6fdb4f6c794/src/wp-includes
/rest-api/fields/class-wp-rest-meta-fields.php#L392
update_metadata returns false if the value is not updated. That also
happens if the old and new value are the same. Which is obviously not an
error.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55467>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list