X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryTags.php;h=e0637ff7313f5584101003604e3bafbd722eb056;hb=27fad304dff43703c40ec93970aaa8760677491b;hp=edd1553c0b63f78f5c8e74db370be726e4f49038;hpb=1690388847edcdcb070427365751745f9706dd82;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryTags.php b/includes/api/ApiQueryTags.php index edd1553c0b..e0637ff731 100644 --- a/includes/api/ApiQueryTags.php +++ b/includes/api/ApiQueryTags.php @@ -59,7 +59,7 @@ class ApiQueryTags extends ApiQueryBase { $this->addTables( 'change_tag' ); $this->addFields( 'ct_tag' ); - $this->addFieldsIf( 'count(*) AS hitcount', $this->fld_hitcount ); + $this->addFieldsIf( array( 'hitcount' => 'COUNT(*)' ), $this->fld_hitcount ); $this->addOption( 'LIMIT', $this->limit + 1 ); $this->addOption( 'GROUP BY', 'ct_tag' ); @@ -73,7 +73,7 @@ class ApiQueryTags extends ApiQueryBase { if ( !$ok ) { break; } - $ok = $this->doTag( $row->ct_tag, $row->hitcount ); + $ok = $this->doTag( $row->ct_tag, $this->fld_hitcount ? $row->hitcount : 0 ); } // include tags with no hits yet @@ -162,7 +162,7 @@ class ApiQueryTags extends ApiQueryBase { 'prop' => array( 'Which properties to get', ' name - Adds name of tag', - ' displayname - Adds system messsage for the tag', + ' displayname - Adds system message for the tag', ' description - Adds description of the tag', ' hitcount - Adds the amount of revisions that have this tag', ), @@ -195,8 +195,4 @@ class ApiQueryTags extends ApiQueryBase { 'api.php?action=query&list=tags&tgprop=displayname|description|hitcount' ); } - - public function getVersion() { - return __CLASS__ . ': $Id$'; - } }