X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=inline;f=includes%2Fchangetags%2FChangeTags.php;h=787464084937db0b77ef63cd1715dc51afb8b946;hb=0ada062ce62a261e55eb2bfbe9c6f74ffbaa05e5;hp=bd9cedc758d939da70aabb12f973feffd9ebf225;hpb=343e911e73f7a8f4195f2afab7d4e12fc069e255;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/changetags/ChangeTags.php b/includes/changetags/ChangeTags.php index bd9cedc758..7874640849 100644 --- a/includes/changetags/ChangeTags.php +++ b/includes/changetags/ChangeTags.php @@ -21,9 +21,7 @@ * @ingroup Change tagging */ -use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; -use MediaWiki\Storage\NameTableStore; use Wikimedia\Rdbms\Database; class ChangeTags { @@ -215,7 +213,7 @@ class ChangeTags { * @param int|null $rc_id The rc_id of the change to add the tags to * @param int|null $rev_id The rev_id of the change to add the tags to * @param int|null $log_id The log_id of the change to add the tags to - * @param string $params Params to put in the ct_params field of table 'change_tag' + * @param string|null $params Params to put in the ct_params field of table 'change_tag' * @param RecentChange|null $rc Recent change, in case the tagging accompanies the action * (this should normally be the case) * @@ -246,7 +244,7 @@ class ChangeTags { * Pass a variable whose value is null if the rev_id is not relevant or unknown. * @param int|null &$log_id The log_id of the change to add the tags to. * Pass a variable whose value is null if the log_id is not relevant or unknown. - * @param string $params Params to put in the ct_params field of table + * @param string|null $params Params to put in the ct_params field of table * 'change_tag' when adding tags * @param RecentChange|null $rc Recent change being tagged, in case the tagging accompanies * the action @@ -348,21 +346,7 @@ class ChangeTags { if ( count( $tagsToAdd ) ) { $changeTagMapping = []; if ( $wgChangeTagsSchemaMigrationStage > MIGRATION_OLD ) { - $changeTagDefStore = new NameTableStore( - MediaWikiServices::getInstance()->getDBLoadBalancer(), - MediaWikiServices::getInstance()->getMainWANObjectCache(), - LoggerFactory::getInstance( 'NameTableSqlStore' ), - 'change_tag_def', - 'ctd_id', - 'ctd_name', - null, - false, - function ( $insertFields ) { - $insertFields['ctd_user_defined'] = 0; - $insertFields['ctd_count'] = 0; - return $insertFields; - } - ); + $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore(); foreach ( $tagsToAdd as $tag ) { $changeTagMapping[$tag] = $changeTagDefStore->acquireId( $tag ); @@ -957,7 +941,7 @@ class ChangeTags { * @param string $tag * @param string $reason * @param User $user Who to attribute the action to - * @param int $tagCount For deletion only, how many usages the tag had before + * @param int|null $tagCount For deletion only, how many usages the tag had before * it was deleted. * @param array $logEntryTags Change tags to apply to the entry * that will be created in the tag management log