Georggi199 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/329768 )
Change subject: Replaced deprecated Linker::link() usages ...................................................................... Replaced deprecated Linker::link() usages Bug: T149346 Change-Id: I4f7bb27ea12543e5ab67403bd89a754956894453 --- M includes/Adapters/Php/MediawikiTemplatePhpAdapter.php M includes/Forms/MetadataDetectForm.php M includes/Forms/MetadataMappingForm.php M includes/Forms/PreviewForm.php M includes/Handlers/Forms/MetadataMappingHandler.php M includes/Models/Mapping.php M includes/Specials/SpecialGWToolset.php 7 files changed, 23 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GWToolset refs/changes/68/329768/1 diff --git a/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php b/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php index 71e24dd..6b0bee9 100644 --- a/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php +++ b/includes/Adapters/Php/MediawikiTemplatePhpAdapter.php @@ -15,7 +15,6 @@ use GWToolset\Config; use GWToolset\GWTException; use GWToolset\Utils; -use Linker; use Title; class MediawikiTemplatePhpAdapter implements DataAdapterInterface { diff --git a/includes/Forms/MetadataDetectForm.php b/includes/Forms/MetadataDetectForm.php index c2e8bc7..911a5c7 100644 --- a/includes/Forms/MetadataDetectForm.php +++ b/includes/Forms/MetadataDetectForm.php @@ -15,7 +15,7 @@ use GWToolset\Utils; use GWToolset\Helpers\FileChecks; use GWToolset\Models\MediawikiTemplate; -use Linker; +use MediaWiki\MediaWikiServices; use SpecialPage; use Title; @@ -72,6 +72,7 @@ $namespace = Utils::getNamespaceName( Config::$metadata_namespace ); $MediawikiTemplate = new MediawikiTemplate( new MediawikiTemplatePhpAdapter() ); $user = $SpecialPage->getUser(); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); return Html::rawElement( @@ -251,7 +252,7 @@ ] ) . Html::rawElement( 'br' ) . - Linker::link( + $linkRenderer->makeLink( Title::newFromText( 'Special:PrefixIndex/' . $namespace . Config::$metadata_mapping_subpage ), @@ -381,6 +382,7 @@ public static function getMetadataFileUrlInput( $namespace ) { $result = null; + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); if ( Constants::USE_FILEBACKEND ) { return $result; @@ -403,7 +405,7 @@ ] ) . Html::rawElement( 'br' ) . - Linker::link( + $linkRenderer->makeLink( Title::newFromText( 'Special:PrefixIndex/' . $namespace . diff --git a/includes/Forms/MetadataMappingForm.php b/includes/Forms/MetadataMappingForm.php index bb0e36e..c522b4c 100644 --- a/includes/Forms/MetadataMappingForm.php +++ b/includes/Forms/MetadataMappingForm.php @@ -12,7 +12,7 @@ use GWToolset\Config; use GWToolset\Utils; use GWToolset\Handlers\Forms\FormHandler; -use Linker; +use MediaWiki\MediaWikiServices; use Title; class MetadataMappingForm { @@ -30,11 +30,12 @@ */ public static function getForm( FormHandler $Handler, array &$user_options ) { + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $template_link = '[[Template:' . Utils::sanitizeString( $user_options['gwtoolset-mediawiki-template-name'] ) . ']]'; $metadata_file_url = !empty( $user_options['Metadata-Title'] ) - ? Linker::link( $user_options['Metadata-Title'], null, [ 'target' => '_blank' ] ) . + ? $linkRenderer->makeLink( $user_options['Metadata-Title'], null, [ 'target' => '_blank' ] ) . Html::rawElement( 'br' ) : null; @@ -650,7 +651,7 @@ ) ) . Html::rawElement( 'br' ) . - Linker::link( + $linkRenderer->makeLink( Title::newFromText( 'Category:' . Config::$source_templates ), null, [ 'target' => '_blank' ] diff --git a/includes/Forms/PreviewForm.php b/includes/Forms/PreviewForm.php index fc7b5f3..628750f 100644 --- a/includes/Forms/PreviewForm.php +++ b/includes/Forms/PreviewForm.php @@ -12,7 +12,7 @@ use GWToolset\Utils; use Html; use IContextSource; -use Linker; +use MediaWiki\MediaWikiServices; use ParserOptions; use SpecialPage; use Title; @@ -42,6 +42,7 @@ array $expected_post_fields, array $metadata_items ) { + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $process_button = Html::rawElement( 'input', @@ -56,9 +57,9 @@ $step1_link = Html::rawElement( 'li', [], - Linker::link( + $linkRenderer->makeLink( SpecialPage::getTitleFor( 'GWToolset' ), - wfMessage( 'gwtoolset-step-1-heading' )->escaped(), + wfMessage( 'gwtoolset-step-1-heading' )->text(), [] ) ); @@ -222,6 +223,7 @@ */ public static function getMetadataAsTitleList( array $metadata_items ) { $result = Html::openElement( 'ul' ); + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); foreach ( $metadata_items as $Title ) { if ( $Title instanceof Title ) { @@ -229,7 +231,7 @@ 'li', [], // Use linkKnown to guard against slave lag for new uploads. - Linker::linkKnown( $Title, null, [ 'target' => '_blank' ] ) + $linkRenderer->makeKnownLink( $Title, null, [ 'target' => '_blank' ] ) ); } } diff --git a/includes/Handlers/Forms/MetadataMappingHandler.php b/includes/Handlers/Forms/MetadataMappingHandler.php index 3dbb964..84a509f 100644 --- a/includes/Handlers/Forms/MetadataMappingHandler.php +++ b/includes/Handlers/Forms/MetadataMappingHandler.php @@ -26,7 +26,7 @@ use GWToolset\Models\Metadata; use Html; use JobQueueGroup; -use Linker; +use MediaWiki\MediaWikiServices; use MWException; use Title; @@ -136,7 +136,8 @@ JobQueueGroup::singleton()->push( $job ); - $newFilesLink = Linker::link( + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); + $newFilesLink = $linkRenderer->makeLink( Title::newFromText( 'Special:NewFiles' ), null, [ 'target' => '_blank' ] diff --git a/includes/Models/Mapping.php b/includes/Models/Mapping.php index 84fa6f1..e051c62 100644 --- a/includes/Models/Mapping.php +++ b/includes/Models/Mapping.php @@ -13,7 +13,7 @@ use GWtoolset\Config; use GWToolset\GWTException; use GWToolset\Utils; -use Linker; +use MediaWiki\MediaWikiServices; class Mapping implements ModelInterface { @@ -88,8 +88,9 @@ } catch ( GWTException $e ) { $error_msg = $e->getMessage(); if ( isset( $options['Metadata-Mapping-Title'] ) ) { + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $error_msg .= ' ' . - Linker::link( + $linkRenderer->makeLink( $options['Metadata-Mapping-Title'], null, [ 'target' => '_blank' ] diff --git a/includes/Specials/SpecialGWToolset.php b/includes/Specials/SpecialGWToolset.php index 9fa501d..a23c66a 100644 --- a/includes/Specials/SpecialGWToolset.php +++ b/includes/Specials/SpecialGWToolset.php @@ -13,7 +13,6 @@ use GWToolset\Helpers\FileChecks; use GWToolset\Helpers\WikiChecks; use Html; -use Linker; use MWException; use SpecialPage; use Title; @@ -135,9 +134,9 @@ $this->getOutput()->addHtml( wfMessage( 'gwtoolset-menu' )->rawParams( - Linker::link( + $this->getLinkRenderer()->makeLink( Title::newFromText( 'Special:' . Constants::EXTENSION_NAME ), - wfMessage( 'gwtoolset-menu-1' )->escaped(), + wfMessage( 'gwtoolset-menu-1' )->text(), [] ) )->parse() -- To view, visit https://gerrit.wikimedia.org/r/329768 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f7bb27ea12543e5ab67403bd89a754956894453 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GWToolset Gerrit-Branch: master Gerrit-Owner: Georggi199 <bmp2...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits