X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fspecialpage%2FWantedQueryPage.php;h=5318895f048935f9692bf331f9a4d8b5e16171b8;hb=6c9a2923fe1ee3a65cb027be5e781772f2b12fbd;hp=9d92cbda5b0fb4c91a3fd31f147c1f57039a9a48;hpb=5772a16583fddb7ef444eb5fee9b9cc1dfb6827f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specialpage/WantedQueryPage.php b/includes/specialpage/WantedQueryPage.php index 9d92cbda5b..5318895f04 100644 --- a/includes/specialpage/WantedQueryPage.php +++ b/includes/specialpage/WantedQueryPage.php @@ -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(); + } + }