Replace Title::isWatchable() with WatchlistManager::isWatchable()

Bug: T281497
Change-Id: I947422fa9aa7f26dcd304da2089b8252b60ab4c1
This commit is contained in:
Cindy Cicalese 2021-04-29 13:38:07 -04:00
parent e0ee81aef7
commit f30f8d43a8
2 changed files with 3 additions and 3 deletions

View file

@ -104,7 +104,7 @@ class ApiWatch extends ApiBase {
}
$title = Title::newFromText( $params['title'] );
if ( !$title || !$title->isWatchable() ) {
if ( !$title || !$this->watchlistManager->isWatchable( $title ) ) {
$this->dieWithError( [ 'invalidtitle', $params['title'] ] );
}
$res = $this->watchTitle( $title, $user, $params, true );
@ -120,7 +120,7 @@ class ApiWatch extends ApiBase {
) {
$res = [ 'title' => $title->getPrefixedText(), 'ns' => $title->getNamespace() ];
if ( !$title->isWatchable() ) {
if ( !$this->watchlistManager->isWatchable( $title ) ) {
$res['watchable'] = 0;
return $res;
}

View file

@ -226,7 +226,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage {
$text = trim( $text );
if ( strlen( $text ) > 0 ) {
$title = Title::newFromText( $text );
if ( $title instanceof Title && $title->isWatchable() ) {
if ( $title instanceof Title && $this->watchlistManager->isWatchable( $title ) ) {
$titles[] = $title;
}
}