Skip to content

Commit

Permalink
(1.43) Replace deprecated Linker::link()
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardspec committed Jan 1, 2025
1 parent 8d05ee4 commit 97f16a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions includes/NavigationTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public static function pfSubpageAnchorNavigation( Parser $parser, $pageName ) {
* @return string|array
*/
protected function generate( PageIdentity $title ) {
$dbr = MediaWikiServices::getInstance()->getDBLoadBalancer()->getConnection( DB_REPLICA );
$services = MediaWikiServices::getInstance();
$dbr = $services->getDBLoadBalancer()->getConnection( DB_REPLICA );

$ns = $title->getNamespace();

// Find all subpages of $title.
Expand Down Expand Up @@ -112,10 +114,11 @@ protected function generate( PageIdentity $title ) {
} );

// Generate navigation links.
$linkRenderer = $services->getLinkRenderer();
$links = [];
foreach ( $anchorsFound as $info ) {
$anchorTitle = Title::makeTitle( $ns, $info['title'], $info['anchor'] );
$links[] = Linker::link( $anchorTitle, $info['text'] );
$links[] = $linkRenderer->makeKnownLink( $anchorTitle, $info['text'] );
}

$resultHtml = Xml::tags( 'div',
Expand Down

0 comments on commit 97f16a5

Please sign in to comment.