X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FWikiPage.php;h=5c7c7fef3b89ab15c0c3e85b30b1760b47e195ed;hb=0e25b050286bed143ed5a23e87d5543fe71ce5dd;hp=7489f446273e3d09b15043d44af18615824b607f;hpb=0812c5e35428e370c69c95da7bc5a152a058f660;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 7489f44627..5c7c7fef3b 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1055,6 +1055,13 @@ class WikiPage implements Page, IDBAccessObject { ) { $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() ) { @@ -3327,7 +3334,7 @@ class WikiPage implements Page, IDBAccessObject { HTMLFileCache::clearFileCache( $title ); $revid = $revision ? $revision->getId() : null; - DeferredUpdates::addCallableUpdate( function() use ( $title, $revid ) { + DeferredUpdates::addCallableUpdate( function () use ( $title, $revid ) { InfoAction::invalidateCache( $title, $revid ); } ); } @@ -3496,7 +3503,10 @@ class WikiPage implements Page, IDBAccessObject { ); 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(); + } ); } } }