Avoid fatal error with FlaggedRevs when running rebuildFileCache.php
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 18 Jan 2017 06:10:03 +0000 (22:10 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 18 Jan 2017 06:10:03 +0000 (22:10 -0800)
Change-Id: I8d335c64cfc74a227528fbd85d333eaaa8157f41

maintenance/rebuildFileCache.php

index da8a6bc..d073282 100644 (file)
@@ -122,6 +122,9 @@ class RebuildFileCache extends Maintenance {
                                $article = Article::newFromTitle( $title, $context );
                                $context->setWikiPage( $article->getPage() );
 
+                               // Some extensions like FlaggedRevs while error out if this is unset
+                               RequestContext::getMain()->setTitle( $title );
+
                                // If the article is cacheable, then load it
                                if ( $article->isFileCacheable( HTMLFileCache::MODE_REBUILD ) ) {
                                        $viewCache = new HTMLFileCache( $title, 'view' );