mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts
synced 2024-11-15 03:35:20 +00:00
Update for rename of WikiPage::isParserCacheUsed() in I7de67937f0
Make the code compatible with both the old name (WikiPage::isParserCacheUsed) and new name (WikiPage::shouldCheckParserCache). Change-Id: If5d5da8eab132eb6d60f7141884ed2aeaa46e444
This commit is contained in:
parent
9a27b49107
commit
7c1ea48971
|
@ -167,7 +167,12 @@ class ApiQueryExtracts extends ApiQueryBase {
|
|||
$this->parserOptions = new ParserOptions( new User( '127.0.0.1' ) );
|
||||
}
|
||||
// first try finding full page in parser cache
|
||||
if ( $page->isParserCacheUsed( $this->parserOptions, 0 ) ) {
|
||||
if ( method_exists( $page, 'isParserCachedUsed' ) ) {
|
||||
$useCache = $page->isParserCacheUsed( $this->parserOptions, 0 );
|
||||
} else {
|
||||
$useCache = $page->shouldCheckParserCache( $this->parserOptions, 0 );
|
||||
}
|
||||
if ( $useCache ) {
|
||||
$pout = ParserCache::singleton()->get( $page, $this->parserOptions );
|
||||
if ( $pout ) {
|
||||
$pout->setTOCEnabled( false );
|
||||
|
|
Loading…
Reference in a new issue