mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-23 16:06:53 +00:00
Merge "ApiDiscussionToolsPageInfo: Show nice error for deleted revisions"
This commit is contained in:
commit
4be9db5ef3
|
@ -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