Merge "Fix error message when trying to reply to transcluded comment on a protected page"

This commit is contained in:
jenkins-bot 2022-05-14 09:23:50 +00:00 committed by Gerrit Code Review
commit 1bc53f313c

View file

@ -149,12 +149,16 @@ function checkThreadItemOnPage( pageName, oldId, threadItem ) {
'discussiontools-error-comment-is-transcluded-title',
mwTitle.getPrefixedText()
).parse();
} else {
} else if ( metadata.canEdit ) {
// If the user can edit, advise them to use the edit button
transcludedErrMsg = mw.message(
'discussiontools-error-comment-is-transcluded',
// eslint-disable-next-line no-jquery/no-global-selector
$( '#ca-edit' ).text()
).parse();
} else {
// Otherwise, tell them why they can't edit
transcludedErrMsg = metadata.notices[ 'permissions-error' ];
}
return $.Deferred().reject( 'comment-is-transcluded', { errors: [ {