Migrate WatchedItemQueryService from tag_summary to change_tag
authorAmir Sarabadani <Ladsgroup@gmail.com>
Tue, 27 Nov 2018 17:20:20 +0000 (18:20 +0100)
committerAmir Sarabadani <Ladsgroup@gmail.com>
Tue, 27 Nov 2018 17:20:20 +0000 (18:20 +0100)
Bug: T209525
Change-Id: I3984355b126c2e36b53f697c26888c1361fdf6af

includes/watcheditem/WatchedItemQueryService.php

index 17d9b91..95b4cb4 100644 (file)
@@ -340,9 +340,6 @@ class WatchedItemQueryService {
                if ( in_array( self::INCLUDE_COMMENT, $options['includeFields'] ) ) {
                        $tables += $this->commentStore->getJoin( 'rc_comment' )['tables'];
                }
-               if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) {
-                       $tables[] = 'tag_summary';
-               }
                if ( in_array( self::INCLUDE_USER, $options['includeFields'] ) ||
                        in_array( self::INCLUDE_USER_ID, $options['includeFields'] ) ||
                        in_array( self::FILTER_ANON, $options['filters'] ) ||
@@ -402,7 +399,7 @@ class WatchedItemQueryService {
                }
                if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) {
                        // prefixed with rc_ to include the field in getRecentChangeFieldsFromRow
-                       $fields['rc_tags'] = 'ts_tags';
+                       $fields['rc_tags'] = ChangeTags::makeTagSummarySubquery( 'recentchanges' );
                }
 
                return $fields;
@@ -710,9 +707,6 @@ class WatchedItemQueryService {
                if ( in_array( self::INCLUDE_COMMENT, $options['includeFields'] ) ) {
                        $joinConds += $this->commentStore->getJoin( 'rc_comment' )['joins'];
                }
-               if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) {
-                       $joinConds['tag_summary'] = [ 'LEFT JOIN', [ 'rc_id=ts_rc_id' ] ];
-               }
                if ( in_array( self::INCLUDE_USER, $options['includeFields'] ) ||
                        in_array( self::INCLUDE_USER_ID, $options['includeFields'] ) ||
                        in_array( self::FILTER_ANON, $options['filters'] ) ||