Due to how things flow through the rendering if an offset is provided
and there are no results, SpecialSearch::showCreateLink gets run twice
and the user gets an odd output.
Bug: T149269
Change-Id: Ifed921207f82cc0d1c1cb621a81127486d4dd03e
$out->addHTML( '<div class="error">' .
$textStatus->getMessage( 'search-error' ) . '</div>' );
} else {
$out->addHTML( '<div class="error">' .
$textStatus->getMessage( 'search-error' ) . '</div>' );
} else {
- $this->showCreateLink( $title, $num, $titleMatches, $textMatches );
+ if ( !$this->offset ) {
+ // If we have an offset the create link was rendered earlier in this function.
+ // This class needs a good de-spaghettification, but for now this will
+ // do the job.
+ $this->showCreateLink( $title, $num, $titleMatches, $textMatches );
+ }
$out->wrapWikiMsg( "<p class=\"mw-search-nonefound\">\n$1</p>",
[ $hasOtherResults ? 'search-nonefound-thiswiki' : 'search-nonefound',
wfEscapeWikiText( $term )
$out->wrapWikiMsg( "<p class=\"mw-search-nonefound\">\n$1</p>",
[ $hasOtherResults ? 'search-nonefound-thiswiki' : 'search-nonefound',
wfEscapeWikiText( $term )