Media: Prevent local edits during media upload.

Prevent `options.allowLocalEdits` from toggling to true during the upload cycle. Otherwise, media meta fields can be edited, but the data will be lost as soon as the upload process is completed.

Props codepo8, oglekler, nicolefurlan, antpb, syamraj24, joedolson.
Fixes #58783, #23374.
Built from https://develop.svn.wordpress.org/trunk@57515


git-svn-id: http://core.svn.wordpress.org/trunk@57016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2024-02-01 16:28:15 +00:00
parent a2786a3785
commit 3664cc3698
3 changed files with 3 additions and 3 deletions

View File

@ -2986,7 +2986,7 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
options.can.save = !! options.nonces.update;
}
if ( this.controller.state().get('allowLocalEdits') ) {
if ( this.controller.state().get('allowLocalEdits') && ! options.uploading ) {
options.allowLocalEdits = true;
}

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57514';
$wp_version = '6.5-alpha-57515';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.