From 87de4241617842f890b415d27b90565162d64ac3 Mon Sep 17 00:00:00 2001 From: Samuel Maenle Date: Sun, 6 Jul 2025 22:44:30 +0200 Subject: [PATCH] Testing old and new title fix --- includes/Targets.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/Targets.php b/includes/Targets.php index cf62205..ed8c658 100644 --- a/includes/Targets.php +++ b/includes/Targets.php @@ -41,7 +41,11 @@ class Targets { * @param String $sourceNamespace The namespace of the current page. * @param Config $config LinkTitles configuration. */ - public static function singleton( \Title $title, Config $config ) { + public static function singleton( \Title|MediaWiki\Title\Title $title, Config $config ) { + // If we received a MediaWiki\Title\Title, convert to legacy Title + if ( $title instanceof MediaWiki\Title\Title ) { + $title = Title::newFromLinkTarget( $title ); + } if ( ( self::$instance === null ) || ( self::$instance->sourceNamespace != $title->getNamespace() ) ) { self::$instance = new Targets( $title, $config ); }