) {
$useParserCache =
( !$forceParse ) && $this->shouldCheckParserCache( $parserOptions, $oldid );
+
+ if ( $useParserCache && !$parserOptions->isSafeToCache() ) {
+ throw new InvalidArgumentException(
+ 'The supplied ParserOptions are not safe to cache. Fix the options or set $forceParse = true.'
+ );
+ }
+
wfDebug( __METHOD__ .
': using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" );
if ( $parserOptions->getStubThreshold() ) {
);
if ( $dbw->affectedRows() > 0 ) {
- $newid = $pageId ?: $dbw->insertId();
+ $newid = $pageId ? (int)$pageId : $dbw->insertId();
$this->mId = $newid;
$this->mTitle->resetArticleID( $newid );
$status->value = $logid;
// Show log excerpt on 404 pages rather than just a link
- $cache = ObjectCache::getMainStashInstance();
- $key = wfMemcKey( 'page-recent-delete', md5( $logTitle->getPrefixedText() ) );
+ $cache = MediaWikiServices::getInstance()->getMainObjectStash();
+ $key = $cache->makeKey( 'page-recent-delete', md5( $logTitle->getPrefixedText() ) );
$cache->set( $key, 1, $cache::TTL_DAY );
return $status;
HTMLFileCache::clearFileCache( $title );
$revid = $revision ? $revision->getId() : null;
- DeferredUpdates::addCallableUpdate( function() use ( $title, $revid ) {
+ DeferredUpdates::addCallableUpdate( function () use ( $title, $revid ) {
InfoAction::invalidateCache( $title, $revid );
} );
}
);
foreach ( $rows as $row ) {
$cat = Category::newFromRow( $row );
- $cat->refreshCounts();
+ // T166757: do the update after this DB commit
+ DeferredUpdates::addCallableUpdate( function () use ( $cat ) {
+ $cat->refreshCounts();
+ } );
}
}
}