r70905 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70904‎ | r70905 | r70906 >
Date:18:45, 11 August 2010
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
CentralNotice: fixes for r70904: Language::commaList() is not static, fixed global name
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialCentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php
@@ -366,7 +366,7 @@
367367 * Print out all campaigns found in db
368368 */
369369 function listNotices() {
370 - global $wgOut, $wgUser, $wgUserLang;
 370+ global $wgOut, $wgUser, $wgLang;
371371
372372 // Get connection
373373 $dbr = wfGetDB( DB_SLAVE );
@@ -409,7 +409,7 @@
410410 'not_project',
411411 'not_locked'
412412 ),
413 - array ( 'not_language' => $wgUserLang ),
 413+ array ( 'not_language' => $wgLang ),
414414 __METHOD__,
415415 array( 'ORDER BY' => 'not_id' )
416416 );
@@ -478,7 +478,7 @@
479479 if ( $language_count > 3 ) {
480480 $languageList = wfMsg ( 'centralnotice-multiple_languages', $language_count );
481481 } elseif ( $language_count > 0 ) {
482 - $languageList = Language::commaList( $project_langs );
 482+ $languageList = $wgLang->commaList( $project_langs );
483483 }
484484 $fields[] = $languageList;
485485

Follow-up revisions

RevisionCommit summaryAuthorDate
r70971->getCode(), fix for r70905kaldari17:16, 12 August 2010
r70979a couple more commaList() fixes, see r70905kaldari18:51, 12 August 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70904localizing comma list per comment at r68694kaldari18:36, 11 August 2010

Comments

#Comment by Kaldari (talk | contribs)   20:02, 11 August 2010

Oops, thanks for fixing that!

#Comment by Catrope (talk | contribs)   12:21, 12 August 2010
-				array ( 'not_language' => $wgUserLang ),
+				array ( 'not_language' => $wgLang ),

Surely the latter should be $wgLang->getCode() ?

#Comment by Ryan Kaldari (WMF) (talk | contribs)   18:05, 12 August 2010

Fixed in r70971. It would great if there were more documentation at http://www.mediawiki.org/wiki/Manual:$wgLang :P

#Comment by Catrope (talk | contribs)   18:06, 12 August 2010

That page makes it quite clear it's an object IMO. Docs for the Language class are at http://svn.wikimedia.org/doc/classLanguage.html

#Comment by Ryan Kaldari (WMF) (talk | contribs)   18:27, 12 August 2010

Sorry, I wasn't saying that this error was caused by bad documentation. It definitely states clearly that it's an object variable. I was just saying it would be nice to have some of the common methods listed on the documentation page. I'll try to add them myself as I use them. Otherwise, feel free to ignore my idle whining ;)

Status & tagging log