jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/383730 )

Change subject: Make sure ReplyWidget isn't destroyed while it's pending
......................................................................


Make sure ReplyWidget isn't destroyed while it's pending

ReplyWidget disables the editor while it's pending,
which means that we'll try to destroy the VE surface while
it's disabled, which breaks.

Bug: T166634
Change-Id: I506d9115e2cbfa8a73307ec9f9c62be0360d05a5
---
M modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
1 file changed, 6 insertions(+), 7 deletions(-)

Approvals:
  Esanders: Looks good to me, approved
  jenkins-bot: Verified
  Jforrester: Looks good to me, but someone else must approve



diff --git a/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js 
b/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
index c3a5ebc..4906480 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.ReplyWidget.js
@@ -130,8 +130,7 @@
                captchaResponse = this.captchaWidget.getResponse();
 
                this.error.setLabel( '' );
-               this.error.toggle( false )
-               ;
+               this.error.toggle( false );
                this.editor.pushPending();
                this.api.saveReply( this.topicId, this.replyTo, content, 
format, captchaResponse )
                        .then( function ( workflow ) {
@@ -144,17 +143,17 @@
                                        widget.canNotEdit.toggle( false );
                                        widget.expanded = false;
                                }
+
+                               // Make sure the widget is no longer pending 
when we emit the event,
+                               // otherwise destroying it breaks (T166634)
+                               widget.editor.popPending();
                                widget.emit( 'saveContent', workflow, content, 
format );
-                       } )
-                       .then( null, function ( errorCode, errorObj ) {
+                       }, function ( errorCode, errorObj ) {
                                widget.captcha.update( errorCode, errorObj );
                                if ( !widget.captcha.isRequired() ) {
                                        widget.error.setLabel( new 
OO.ui.HtmlSnippet( errorObj.error && errorObj.error.info || errorObj.exception 
) );
                                        widget.error.toggle( true );
                                }
-
-                       } )
-                       .always( function () {
                                widget.editor.popPending();
                        } );
        };

-- 
To view, visit https://gerrit.wikimedia.org/r/383730
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I506d9115e2cbfa8a73307ec9f9c62be0360d05a5
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope <r...@wikimedia.org>
Gerrit-Reviewer: Catrope <r...@wikimedia.org>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to