Merge "Restore error message for when comment is deleted while replying"

This commit is contained in:
jenkins-bot 2020-07-31 15:02:55 +00:00 committed by Gerrit Code Review
commit 3e813316b0
2 changed files with 7 additions and 8 deletions

View file

@ -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 () {

View file

@ -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 );