Media: Display an error message in grid view if the attachment could not be deleted.
Previously, the attachment was silently removed from the grid but reappeared after a page reload. Follow-up to [22869]. Props kapilpaul, costdev, mukesh27, azouamauriac, SergeyBiryukov. Fixes #55158. Built from https://develop.svn.wordpress.org/trunk@52725 git-svn-id: http://core.svn.wordpress.org/trunk@52314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3c27e50dd6
commit
21a51e9993
|
@ -8491,7 +8491,13 @@ Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototyp
|
|||
this.getFocusableElements();
|
||||
|
||||
if ( window.confirm( l10n.warnDelete ) ) {
|
||||
this.model.destroy();
|
||||
this.model.destroy( {
|
||||
wait: true,
|
||||
error: function() {
|
||||
window.alert( l10n.errorDeleting );
|
||||
}
|
||||
} );
|
||||
|
||||
this.moveFocus();
|
||||
}
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4482,6 +4482,7 @@ function wp_enqueue_media( $args = array() ) {
|
|||
'trashSelected' => __( 'Move to Trash' ),
|
||||
'restoreSelected' => __( 'Restore from Trash' ),
|
||||
'deletePermanently' => __( 'Delete permanently' ),
|
||||
'errorDeleting' => __( 'Error in deleting the attachment.' ),
|
||||
'apply' => __( 'Apply' ),
|
||||
'filterByDate' => __( 'Filter by date' ),
|
||||
'filterByType' => __( 'Filter by type' ),
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.0-alpha-52724';
|
||||
$wp_version = '6.0-alpha-52725';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue