Merge "Unbreak extensions using SpecialSearchResults hook"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 18 Jan 2017 22:44:01 +0000 (22:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 18 Jan 2017 22:44:02 +0000 (22:44 +0000)
docs/hooks.txt
includes/widget/search/FullSearchResultWidget.php
maintenance/rebuildFileCache.php

index ef47218..c5b112d 100644 (file)
@@ -2822,7 +2822,7 @@ $terms: Search terms, for highlighting
   function returned false.
 
 'ShowSearchHitTitle': Customise display of search hit title/link.
-$title: Title to link to
+&$title: Title to link to
 &$text: Text to use for the link
 $result: The search result
 $terms: The search terms entered
index a93e1fc..69bfa6d 100644 (file)
@@ -134,7 +134,7 @@ class FullSearchResultWidget implements SearchResultWidget {
                $queryString = [];
 
                Hooks::run( 'ShowSearchHitTitle',
-                       [ $title, &$snippet, $result, $terms, $this->specialPage, &$queryString ] );
+                       [ &$title, &$snippet, $result, $terms, $this->specialPage, &$queryString ] );
 
                $link = $this->linkRenderer->makeLink(
                        $title,
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' );