From 9f9261f051591f63e570676502d6ee94d9e6cc03 Mon Sep 17 00:00:00 2001 From: Anthony Burchell Date: Tue, 8 Jun 2021 23:12:23 +0000 Subject: [PATCH] Media: Allow multi-uploads in Galleries. Previously, when more than one media item was uploaded using a gallery, failures occurred on the second upload. Props glendaviesnz, Mista-Flo, hellofromTonya. Fixes #53169. git-svn-id: https://develop.svn.wordpress.org/trunk@51123 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/media/views/uploader/status.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/media/views/uploader/status.js b/src/js/media/views/uploader/status.js index a21c278395..86c538b833 100644 --- a/src/js/media/views/uploader/status.js +++ b/src/js/media/views/uploader/status.js @@ -96,9 +96,11 @@ UploaderStatus = View.extend(/** @lends wp.media.view.UploaderStatus.prototype * return attachment.get('uploading'); }); - this.$index.text( index + 1 ); - this.$total.text( queue.length ); - this.$filename.html( active ? this.filename( active.get('filename') ) : '' ); + if ( this.$index && this.$total && this.$filename ) { + this.$index.text( index + 1 ); + this.$total.text( queue.length ); + this.$filename.html( active ? this.filename( active.get('filename') ) : '' ); + } }, /** * @param {string} filename