mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
ApiDiscussionToolsPageInfo: Show nice error for deleted revisions
This is similar fix as b8a28d6cfc
.
Bug: T380351
Change-Id: I1b03a00c5627e1fa9e48aee9e2ed3d8b1ea332f7
This commit is contained in:
parent
b6496ab427
commit
6e17c85409
|
@ -12,6 +12,7 @@ use MediaWiki\Extension\DiscussionTools\ThreadItem\ContentHeadingItem;
|
|||
use MediaWiki\Extension\DiscussionTools\ThreadItem\ContentThreadItem;
|
||||
use MediaWiki\Extension\VisualEditor\VisualEditorParsoidClientFactory;
|
||||
use MediaWiki\Revision\RevisionLookup;
|
||||
use MediaWiki\Revision\RevisionRecord;
|
||||
use MediaWiki\Title\Title;
|
||||
use Wikimedia\ParamValidator\ParamValidator;
|
||||
use Wikimedia\Parsoid\Core\ResourceLimitExceededException;
|
||||
|
@ -112,6 +113,10 @@ class ApiDiscussionToolsPageInfo extends ApiBase {
|
|||
return new ContentThreadItemSet;
|
||||
}
|
||||
|
||||
if ( !$revision->audienceCan( RevisionRecord::DELETED_TEXT, RevisionRecord::FOR_PUBLIC ) ) {
|
||||
$this->dieWithError( [ 'apierror-missingcontent-revid', $revision->getId() ], 'missingcontent' );
|
||||
}
|
||||
|
||||
try {
|
||||
return HookUtils::parseRevisionParsoidHtml( $revision, __METHOD__ );
|
||||
} catch ( ResourceLimitExceededException $e ) {
|
||||
|
|
Loading…
Reference in a new issue