r83915 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83914‎ | r83915 | r83916 >
Date:16:25, 14 March 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Avoid fatals when message definitions have not yet been initialized
Modified paths:
  • /trunk/extensions/Translate/Groups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Groups.php
@@ -263,8 +263,14 @@
264264
265265 protected function parseTags( $patterns ) {
266266 $cache = new MessageGroupCache( $this->getId() );
267 - $messageKeys = $cache->getKeys();
268267
 268+ if ( !$cache->exists() ) {
 269+ wfWarn( "By-passing message group cache" );
 270+ $messageKeys = array_keys( $this->load( 'en' ) );
 271+ } else {
 272+ $messageKeys = $cache->getKeys();
 273+ }
 274+
269275 $matches = array();
270276
271277 /**

Status & tagging log