Index: trunk/extensions/Translate/specials/SpecialLanguageStats.php |
— | — | @@ -77,6 +77,15 @@ |
78 | 78 | */ |
79 | 79 | protected $purge; |
80 | 80 | |
| 81 | + /** |
| 82 | + * Helper variable to avoid overcounting message groups that appear |
| 83 | + * multiple times in the list with different parents. Aggregate message |
| 84 | + * group stats are always excluded from totals. |
| 85 | + * |
| 86 | + * @var array |
| 87 | + */ |
| 88 | + protected $statsCounted = array(); |
| 89 | + |
81 | 90 | public function __construct() { |
82 | 91 | parent::__construct( 'LanguageStats' ); |
83 | 92 | |
— | — | @@ -392,8 +401,12 @@ |
393 | 402 | } |
394 | 403 | } |
395 | 404 | |
396 | | - if ( !$group instanceof AggregateMessageGroup ) { |
397 | | - $this->totals = MessageGroupStats::multiAdd( $this->totals, $stats ); |
| 405 | + |
| 406 | + if ( !$group instanceof AggregateMessageGroup ) { |
| 407 | + if ( !isset( $this->statsCounted[$groupId] ) ) { |
| 408 | + $this->totals = MessageGroupStats::multiAdd( $this->totals, $stats ); |
| 409 | + $this->statsCounted[$groupId] = true; |
| 410 | + } |
398 | 411 | } |
399 | 412 | |
400 | 413 | $rowParams = array(); |