X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FChangeTags.php;h=53f2955d443ea12e8671df10f84639495b940331;hb=c7dbaa0f580cbd6fc8c5e3664e55d6bee1c29136;hp=fd94bea31a1fc33ac3f40fa51a08ffbfa645bda8;hpb=757a6ae690f3ff95cf7bf7b7505f9577d542da43;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php index fd94bea31a..53f2955d44 100644 --- a/includes/ChangeTags.php +++ b/includes/ChangeTags.php @@ -184,17 +184,19 @@ class ChangeTags { // Figure out which conditions can be done. if ( in_array( 'recentchanges', $tables ) ) { - $join_cond = 'rc_id'; + $join_cond = 'ct_rc_id=rc_id'; } elseif ( in_array( 'logging', $tables ) ) { - $join_cond = 'log_id'; + $join_cond = 'ct_log_id=log_id'; } elseif ( in_array( 'revision', $tables ) ) { - $join_cond = 'rev_id'; + $join_cond = 'ct_rev_id=rev_id'; + } elseif ( in_array( 'archive', $tables ) ) { + $join_cond = 'ct_rev_id=ar_rev_id'; } else { throw new MWException( 'Unable to determine appropriate JOIN condition for tagging.' ); } $fields['ts_tags'] = wfGetDB( DB_SLAVE )->buildGroupConcatField( - ',', 'change_tag', 'ct_tag', "ct_$join_cond=$join_cond" + ',', 'change_tag', 'ct_tag', $join_cond ); if ( $wgUseTagFilter && $filter_tag ) { @@ -202,7 +204,7 @@ class ChangeTags { // Add an INNER JOIN on change_tag $tables[] = 'change_tag'; - $join_conds['change_tag'] = array( 'INNER JOIN', "ct_$join_cond=$join_cond" ); + $join_conds['change_tag'] = array( 'INNER JOIN', $join_cond ); $conds['ct_tag'] = $filter_tag; } }