r72111 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72110‎ | r72111 | r72112 >
Date:16:09, 1 September 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Add transition time support for old style groups to AggregateMessageGroup
Modified paths:
  • /trunk/extensions/Translate/Groups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Groups.php
@@ -490,9 +490,7 @@
491491 $ids = (array) $this->conf['GROUPS'];
492492
493493 foreach ( $ids as $id ) {
494 - /**
495 - * Do not try to include self and go to infinite loop.
496 - */
 494+ // Do not try to include self and go to infinite loop.
497495 if ( $id === $this->getId() ) {
498496 continue;
499497 }
@@ -502,7 +500,7 @@
503501 error_log( "Invalid group id in {$this->getId()}: $id" );
504502 continue;
505503 }
506 - $groups[$id] = $group;
 504+ $groups[$id] = $group;
507505 }
508506 $this->groups = $groups;
509507 }
@@ -513,8 +511,13 @@
514512 $messages = array();
515513 foreach ( $this->getGroups() as $group ) {
516514 $cache = new MessageGroupCache( $group );
517 - foreach ( $cache->getKeys() as $key ) {
518 - $messages[$key] = $cache->get( $key );
 515+ if ( $cache->exists() ) {
 516+ foreach ( $cache->getKeys() as $key ) {
 517+ $messages[$key] = $cache->get( $key );
 518+ }
 519+ } else {
 520+ // BC for MessageGroupOld
 521+ $messages = wfArrayMerge( $messages, $group->load( 'en' ) );
519522 }
520523 }
521524

Status & tagging log