r54261 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54260‎ | r54261 | r54262 >
Date:09:54, 3 August 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Label was missing
* Some code to try to figure out where undefined index error is coming
Modified paths:
  • /trunk/extensions/Translate/groups/ComplexMessages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/groups/ComplexMessages.php
@@ -489,7 +489,10 @@
490490 }
491491
492492 public function highlight( $key, $values ) {
493 - if ( count( $values ) ) $values[0] = "<b>$values[0]</b>";
 493+ if ( count( $values ) ) {
 494+ if ( !isset($values[0]) ) throw new MWException( "Something missing from values: " . print_rt( $values, true ) );
 495+ $values[0] = "<b>$values[0]</b>";
 496+ }
494497 return $values;
495498 }
496499
@@ -567,8 +570,9 @@
568571
569572 public function __construct( $code ) {
570573 parent::__construct( $code );
571 - $this->data['MediaWiki Core'] = array(
572 - 'var' => 'namespaceNames',
 574+ $this->data['core'] = array(
 575+ 'label'=> 'MediaWiki Core',
 576+ 'var' => 'namespaceNames',
573577 'file' => Language::getMessagesFileName( '%CODE%' ),
574578 'code' => false,
575579 );

Status & tagging log