Merge "[search] Don't show the create link twice on results page"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 8 Nov 2016 18:36:57 +0000 (18:36 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 8 Nov 2016 18:36:57 +0000 (18:36 +0000)
includes/specials/SpecialSearch.php

index e7a8677..9280b04 100644 (file)
@@ -417,7 +417,12 @@ class SpecialSearch extends SpecialPage {
                                $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 )