"Krinkle" posted a comment on MediaWiki.r80240.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/80240#c30177

Commit summary for MediaWiki.r80240:

Fix bug 14267 by adding support for a MediaWiki:Mainpage-nstab.
Additionally, *cough* *cough*:
* Add a Title::isMainPage helper for the fairly common $title->equals( 
Title::newMainPage() ); test.
* Update wfMessageFallback to also accept an array of message keys instead of 
requiring them listed as arguments to the function.
* Move the bulk of wfMessageFallback code into Message.php instead of leaving 
it in GlobalFunctions.php
* Change the wfMessageFallback implementation so that the Message class handles 
the fallbacks themselves eliminating any side effects caused by the fact that 
wfEmptyMsg always used usedb=false, language=userlang when one might actually 
use a different language or usedb setting in the message object that actually 
returned the text (this may be considered a wfEmptyMsg regression in 1.18).
* Make blank "" message contents fallback like nonexistant messages do.
* Re use the new tabAction array handling used to support mainpage-nstab in the 
talk and view tabs instead of making wfEmptyMsg calls directly in SkinTemplate.

Krinkle's comment:

<pre>Notice: Undefined variable: message in 
mediawiki/trunk/phase3/includes/Message.php on line 580</pre>

Comes from this function:

<pre>
        protected function fetchMessage() {
                if ( !isset( $this->message ) ) {
                        global $wgMessageCache;
-                       $this->message = $wgMessageCache->get( $this->key, 
$this->useDatabase, $this->language );
+                       if ( is_array($this->key) ) {
+                               foreach ( $this->key as $key ) {
+                                       $message = $wgMessageCache->get( $key, 
$this->useDatabase, $this->language );
+                                       if ( $message !== false && $message !== 
'' ) {
+                                               break;
+                                       }
+                               }
+                               $this->message = $message;
+                       } else {
+                               $this->message = $wgMessageCache->get( 
$this->key, $this->useDatabase, $this->language );
+                       }
                }
                return $this->message;
        }
</pre>

<code>$message</code> will be undefined if <code>$this->key</code> is an empty 
array, which it apparently is in some cases because I'm getting this notice on 
regular pages from a clean checkout.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to