From c55cdfa85dbd1b2bc90cf2cf9dbbe1eb2e68cd38 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 26 Mar 2014 22:55:10 +0000 Subject: [PATCH] Properly render the image details modal when the image references an invalid attachment. props gcorne. fixes #27537. git-svn-id: https://develop.svn.wordpress.org/trunk@27756 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-views.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index be0ee8fd3f..fd40f31579 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -5930,11 +5930,15 @@ render: function() { var self = this, args = arguments; + if ( this.model.attachment && 'pending' === this.model.dfd.state() ) { - // should instead show a spinner when the attachment is new and then add a listener that updates on change this.model.dfd.done( function() { media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args ); self.resetFocus(); + } ).fail( function() { + self.model.attachment = false; + media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args ); + self.resetFocus(); } ); } else { media.view.Settings.AttachmentDisplay.prototype.render.apply( this, arguments );