r89734 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89733‎ | r89734 | r89735 >
Date:18:56, 8 June 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
followup r89730: catch non-local setting
Modified paths:
  • /trunk/extensions/Lingo/Lingo.i18n.php (modified) (history)
  • /trunk/extensions/Lingo/LingoBasicBackend.php (modified) (history)
  • /trunk/extensions/Lingo/LingoMessageLog.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Lingo/LingoMessageLog.php
@@ -30,14 +30,22 @@
3131
3232 function addMessage( $message, $severity = self::MESSAGE_NOTICE ) {
3333 $this->mMessages[] = array($message, $severity);
 34+
 35+ // log errors and warnings in debug log
 36+ if ( $severity == self::MESSAGE_WARNING ||
 37+ $severity == self::MESSAGE_ERROR ) {
 38+ wfDebug( $message );
 39+ }
3440 }
3541
3642 function addError( $message ) {
3743 $this->mMessages[] = array($message, self::MESSAGE_ERROR);
 44+ wfDebug( "Error: $message\n" );
3845 }
3946
4047 function addWarning( $message ) {
4148 $this->mMessages[] = array($message, self::MESSAGE_WARNING);
 49+ wfDebug( "Warning: $message\n" );
4250 }
4351
4452 function addNotice( $message ) {
Index: trunk/extensions/Lingo/LingoBasicBackend.php
@@ -29,7 +29,13 @@
3030 parent::__construct( $messages );
3131
3232 // Get Terminology page
33 - $rev = Revision::newFromTitle( Title::makeTitle( null, $page ) );
 33+ $title = Title::newFromText( $page );
 34+ if ( $title->getInterwiki() ) {
 35+ $this->getMessageLog()->addError( wfMsgReal( 'lingo-terminologypagenotlocal', array($page) ) );
 36+ return false;
 37+ }
 38+
 39+ $rev = Revision::newFromTitle( $title );
3440 if ( !$rev ) {
3541 $this->getMessageLog()->addWarning( wfMsgReal( 'lingo-noterminologypage', array($page) ) );
3642 return false;
Index: trunk/extensions/Lingo/Lingo.i18n.php
@@ -12,6 +12,7 @@
1313 'lingo-desc' => 'Provides hover-over tool tips on pages from words defined on the [[$1]] page',
1414 'lingo-terminologypagename' => 'Terminology',
1515 'lingo-noterminologypage' => '[[$1]] does not exist.',
 16+ 'lingo-terminologypagenotlocal' => '[[$1]] is not a local page.',
1617
1718 );
1819

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89730introduce setting for page to use for glossaryfoxtrott17:03, 8 June 2011

Status & tagging log