X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialSearch.php;h=85b4572bd5234ce853f0b16d8f0bf8c214f70887;hb=69f16b7a69f9491b695ba0c9dfab7a7bdcb591d7;hp=e89dbc96ed45738d0d0b601f1da556e0373a94c4;hpb=b5e0337ddb857bf2f7a37aa7b7ba1b081a578e8c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index e89dbc96ed..85b4572bd5 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -352,7 +352,7 @@ class SpecialSearch extends SpecialPage { $out->addHTML( $dymWidget->render( $term, $textMatches ) ); } - $hasErrors = $textStatus && $textStatus->getErrors(); + $hasErrors = $textStatus && $textStatus->getErrors() !== []; $hasOtherResults = $textMatches && $textMatches->hasInterwikiResults( SearchResultSet::INLINE_RESULTS ); @@ -399,7 +399,6 @@ class SpecialSearch extends SpecialPage { $mainResultWidget = new FullSearchResultWidget( $this, $linkRenderer ); if ( $search->getFeatureData( 'enable-new-crossproject-page' ) ) { - $sidebarResultWidget = new InterwikiSearchResultWidget( $this, $linkRenderer ); $sidebarResultsWidget = new InterwikiSearchResultSetWidget( $this, @@ -436,9 +435,17 @@ class SpecialSearch extends SpecialPage { // prev/next links if ( $totalRes > $this->limit || $this->offset ) { + // Allow matches to define the correct offset, as interleaved + // AB testing may require a different next page offset. + if ( $textMatches && $textMatches->getOffset() !== null ) { + $offset = $textMatches->getOffset(); + } else { + $offset = $this->offset; + } + $prevnext = $this->getLanguage()->viewPrevNext( $this->getPageTitle(), - $this->offset, + $offset, $this->limit, $this->powerSearchOptions() + [ 'search' => $term ], $this->limit + $this->offset >= $totalRes @@ -548,7 +555,7 @@ class SpecialSearch extends SpecialPage { * Extract "power search" namespace settings from the request object, * returning a list of index numbers to search. * - * @param WebRequest $request + * @param WebRequest &$request * @return array */ protected function powerSearch( &$request ) {