Changes between Version 1 and Version 2 of Ticket #55600, comment 13
- Timestamp:
- 06/26/2024 10:21:45 AM (20 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #55600, comment 13
v1 v2 5 5 Without the change from `get_metadata` to `get_metadata_raw` any updates of keys registered as non-single make the whole request fail with a 500 error. 6 6 7 This is due to the fact that [https://github.com/WordPress/wordpress-develop/blob/df256e414c183ff001cdf26ebf37b19b960180de/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php#L265-L364 `update_multi_meta_value`] does delete existing values before it re-adds them. But since it thinks of the non-stored values as stored and then tries to delete them the deletion fails resulting in the whole request to abort and fail with a 500.7 This is due to the fact that [https://github.com/WordPress/wordpress-develop/blob/df256e414c183ff001cdf26ebf37b19b960180de/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php#L265-L364 `update_multi_meta_value`] does delete existing values before it re-adds them. But since it wrongly thinks of the non-stored values as stored and then tries to delete them the deletion fails resulting in the whole request to abort and fail with a 500. 8 8 9 9 Funnily this applies in the inverse: To any meta type except string: Since strings are the only one considered equal to the default the update bails early and doesn't run into this issue.