X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fwatcheditem%2FWatchedItemQueryService.php;h=3478b0894c9ae16d2b28cc9bdd497626152dc21c;hb=11ee7f78da9776db26098642a151a288f98bea14;hp=d0f45bec171016779236eab031affa3742365d61;hpb=587d08c5a626f8195def9f82ee83e17c85824db8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/watcheditem/WatchedItemQueryService.php b/includes/watcheditem/WatchedItemQueryService.php index d0f45bec17..3478b0894c 100644 --- a/includes/watcheditem/WatchedItemQueryService.php +++ b/includes/watcheditem/WatchedItemQueryService.php @@ -27,6 +27,7 @@ class WatchedItemQueryService { const INCLUDE_PATROL_INFO = 'patrol'; const INCLUDE_SIZES = 'sizes'; const INCLUDE_LOG_INFO = 'loginfo'; + const INCLUDE_TAGS = 'tags'; // FILTER_* constants are part of public API (are used in ApiQueryWatchlist and // ApiQueryWatchlistRaw classes) and should not be changed. @@ -335,6 +336,9 @@ class WatchedItemQueryService { if ( in_array( self::INCLUDE_COMMENT, $options['includeFields'] ) ) { $tables += $this->getCommentStore()->getJoin()['tables']; } + if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) { + $tables[] = 'tag_summary'; + } return $tables; } @@ -384,6 +388,10 @@ class WatchedItemQueryService { if ( in_array( self::INCLUDE_LOG_INFO, $options['includeFields'] ) ) { $fields = array_merge( $fields, [ 'rc_logid', 'rc_log_type', 'rc_log_action', 'rc_params' ] ); } + if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) { + // prefixed with rc_ to include the field in getRecentChangeFieldsFromRow + $fields['rc_tags'] = 'ts_tags'; + } return $fields; } @@ -678,6 +686,9 @@ class WatchedItemQueryService { if ( in_array( self::INCLUDE_COMMENT, $options['includeFields'] ) ) { $joinConds += $this->getCommentStore()->getJoin()['joins']; } + if ( in_array( self::INCLUDE_TAGS, $options['includeFields'] ) ) { + $joinConds['tag_summary'] = [ 'LEFT JOIN', [ 'rc_id=ts_rc_id' ] ]; + } return $joinConds; }