Special:RecentChangesLinked show "no results" message
authorStephane Bisson <sbisson@wikimedia.org>
Wed, 29 Mar 2017 16:36:49 +0000 (12:36 -0400)
committerStephane Bisson <sbisson@wikimedia.org>
Wed, 29 Mar 2017 16:36:49 +0000 (12:36 -0400)
Bug: T160482
Change-Id: I26743928b359ad052ff53bde281f0479cbe68a99

includes/specialpage/ChangesListSpecialPage.php
includes/specials/SpecialRecentchanges.php

index 0a8c9f4..2ece5aa 100644 (file)
@@ -427,6 +427,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                if ( $rows === false ) {
                        if ( !$this->including() ) {
                                $this->doHeader( $opts, 0 );
+                               $this->outputNoResults();
                                $this->getOutput()->setStatusCode( 404 );
                        }
 
@@ -446,7 +447,6 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        }
                }
                $batch->execute();
-
                $this->webOutput( $rows, $opts );
 
                $rows->free();
@@ -460,6 +460,17 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                }
        }
 
+       /**
+        * Add the "no results" message to the output
+        */
+       protected function outputNoResults() {
+               $this->getOutput()->addHTML(
+                       '<div class="mw-changeslist-empty">' .
+                       $this->msg( 'recentchanges-noresult' )->parse() .
+                       '</div>'
+               );
+       }
+
        /**
         * Get the database result for this special page instance. Used by ApiFeedRecentChanges.
         *
index 205f7cf..3e7971a 100644 (file)
@@ -398,11 +398,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                $rclistOutput .= $list->endRecentChangesList();
 
                if ( $rows->numRows() === 0 ) {
-                       $this->getOutput()->addHTML(
-                               '<div class="mw-changeslist-empty">' .
-                               $this->msg( 'recentchanges-noresult' )->parse() .
-                               '</div>'
-                       );
+                       $this->outputNoResults();
                        if ( !$this->including() ) {
                                $this->getOutput()->setStatusCode( 404 );
                        }