Merge "Replace 'TablePager' CSS class exclusively by `mw-datatable`"
[lhc/web/wiklou.git] / includes / changetags / ChangeTags.php
index 32cfd13..00eed14 100644 (file)
@@ -141,11 +141,11 @@ class ChangeTags {
         * we consider the tag hidden, and return false.
         *
         * @param string $tag
-        * @param IContextSource $context
+        * @param MessageLocalizer $context
         * @return string|bool Tag description or false if tag is to be hidden.
         * @since 1.25 Returns false if tag is to be hidden.
         */
-       public static function tagDescription( $tag, IContextSource $context ) {
+       public static function tagDescription( $tag, MessageLocalizer $context ) {
                $msg = $context->msg( "tag-$tag" );
                if ( !$msg->exists() ) {
                        // No such message, so return the HTML-escaped tag name.
@@ -168,11 +168,11 @@ class ChangeTags {
         * for the long description.
         *
         * @param string $tag
-        * @param IContextSource $context
+        * @param MessageLocalizer $context
         * @return Message|bool Message object of the tag long description or false if
         *  there is no description.
         */
-       public static function tagLongDescriptionMessage( $tag, IContextSource $context ) {
+       public static function tagLongDescriptionMessage( $tag, MessageLocalizer $context ) {
                $msg = $context->msg( "tag-$tag-description" );
                if ( !$msg->exists() ) {
                        return false;
@@ -196,6 +196,8 @@ class ChangeTags {
         * @return string Truncated long tag description.
         */
        public static function truncateTagDescription( $tag, $length, IContextSource $context ) {
+               // FIXME: Make this accept MessageLocalizer and Language instead of IContextSource
+
                $originalDesc = self::tagLongDescriptionMessage( $tag, $context );
                // If there is no tag description, return empty string
                if ( !$originalDesc ) {
@@ -420,15 +422,13 @@ class ChangeTags {
                        }
                }
 
-               self::purgeTagUsageCache();
-
                Hooks::run( 'ChangeTagsAfterUpdateTags', [ $tagsToAdd, $tagsToRemove, $prevTags,
                        $rc_id, $rev_id, $log_id, $params, $rc, $user ] );
 
                return [ $tagsToAdd, $tagsToRemove, $prevTags ];
        }
 
-       private static function getPrevTags( $rc_id = null, $rev_id = null, $log_id = null ) {
+       private static function getPrevTags( $rc_id = null, $log_id = null, $rev_id = null ) {
                $conds = array_filter(
                        [
                                'ct_rc_id' => $rc_id,
@@ -756,7 +756,7 @@ class ChangeTags {
                        // Add an INNER JOIN on change_tag
 
                        $tables[] = 'change_tag';
-                       $join_conds['change_tag'] = [ 'INNER JOIN', $join_cond ];
+                       $join_conds['change_tag'] = [ 'JOIN', $join_cond ];
                        $filterTagIds = [];
                        $changeTagDefStore = MediaWikiServices::getInstance()->getChangeTagDefStore();
                        foreach ( (array)$filter_tag as $filterTagName ) {
@@ -808,7 +808,7 @@ class ChangeTags {
                }
 
                $tagTables = [ 'change_tag', 'change_tag_def' ];
-               $join_cond_ts_tags = [ 'change_tag_def' => [ 'INNER JOIN', 'ct_tag_id=ctd_id' ] ];
+               $join_cond_ts_tags = [ 'change_tag_def' => [ 'JOIN', 'ct_tag_id=ctd_id' ] ];
                $field = 'ctd_name';
 
                return wfGetDB( DB_REPLICA )->buildGroupConcatField(
@@ -1456,18 +1456,15 @@ class ChangeTags {
                $cache->touchCheckKey( $cache->makeKey( 'valid-tags-hook' ) );
 
                MediaWikiServices::getInstance()->getChangeTagDefStore()->reloadMap();
-
-               self::purgeTagUsageCache();
        }
 
        /**
         * Invalidates the tag statistics cache only.
         * @since 1.25
+        * @deprecated since 1.33 the cache this purges no longer exists
         */
        public static function purgeTagUsageCache() {
-               $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
-
-               $cache->touchCheckKey( $cache->makeKey( 'change-tag-statistics' ) );
+               wfDeprecated( __METHOD__, '1.33' );
        }
 
        /**