diff --git a/modules/CommentController.js b/modules/CommentController.js index 9971fc034..b7f7c5a5c 100644 --- a/modules/CommentController.js +++ b/modules/CommentController.js @@ -303,6 +303,13 @@ CommentController.prototype.save = function ( comment, pageName ) { if ( code === 'editconflict' ) { return commentController.save( comment, pageName ); } + // Better user-facing error message + if ( code === 'discussiontools-commentid-notfound' ) { + return $.Deferred().reject( 'discussiontools-commentid-notfound', { errors: [ { + code: 'discussiontools-commentid-notfound', + html: mw.message( 'discussiontools-error-comment-disappeared' ).parse() + } ] } ).promise(); + } return $.Deferred().reject( code, data ).promise(); } ); savePromise.then( function () { diff --git a/modules/controller.js b/modules/controller.js index 9ef41eb6d..bc35db205 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -121,14 +121,6 @@ function checkCommentOnPage( pageName, oldId, commentId ) { lintErrors = response.linterrors, transcludedFrom = response.transcludedfrom; - // We no longer check if the comment exists on the page, is this an issue? - // if ( !comment ) { - // return $.Deferred().reject( 'comment-disappeared', { errors: [ { - // code: 'comment-disappeared', - // html: mw.message( 'discussiontools-error-comment-disappeared' ).parse() - // } ] } ).promise(); - // } - isTranscludedFrom = transcludedFrom[ commentId ]; if ( isTranscludedFrom ) { mwTitle = isTranscludedFrom === true ? null : mw.Title.newFromText( isTranscludedFrom );