Merge "Add 3D filetype for STL files"
[lhc/web/wiklou.git] / includes / specialpage / WantedQueryPage.php
index 9d92cbd..5318895 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Class definition for a wanted query page like
@@ -116,7 +117,40 @@ abstract class WantedQueryPage extends QueryPage {
         */
        private function makeWlhLink( $title, $result ) {
                $wlh = SpecialPage::getTitleFor( 'Whatlinkshere', $title->getPrefixedText() );
-               $label = $this->msg( 'nlinks' )->numParams( $result->value )->escaped();
-               return Linker::link( $wlh, $label );
+               $label = $this->msg( 'nlinks' )->numParams( $result->value )->text();
+               return $this->getLinkRenderer()->makeLink( $wlh, $label );
        }
+
+       /**
+        * Order by title for pages with the same number of links to them
+        *
+        * @return array
+        * @since 1.29
+        */
+       function getOrderFields() {
+               return [ 'value DESC', 'namespace', 'title' ];
+       }
+
+       /**
+        * Do not order descending for all order fields.  We will use DESC only on one field, see
+        * getOrderFields above. This overwrites sortDescending from QueryPage::getOrderFields().
+        * Do NOT change this to true unless you remove the phrase DESC in getOrderFiels above.
+        * If you do a database error will be thrown due to double adding DESC to query!
+        *
+        * @return bool
+        * @since 1.29
+        */
+       function sortDescending() {
+               return false;
+       }
+
+       /**
+        * Also use the order fields returned by getOrderFields when fetching from the cache.
+        * @return array
+        * @since 1.29
+        */
+       function getCacheOrderFields() {
+               return $this->getOrderFields();
+       }
+
 }