r101980 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101979‎ | r101980 | r101981 >
Date:11:58, 4 November 2011
Author:nikerabbit
Status:resolved
Tags:
Comment:
Try to fix fatal error
Modified paths:
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -906,7 +906,12 @@
907907 }
908908
909909 // Using newFromId instead of newFromTitle, because the page might have been renamed
910 - $oldtext = Revision::newFromId( $translationRevision )->getText();
 910+ $oldrev = Revision::newFromId( $translationRevision );
 911+ if ( !$oldev ) {
 912+ // And someone might still have deleted it
 913+ return null;
 914+ }
 915+ $oldtext = $oldrev->getText();
911916 $newtext = Revision::newFromTitle( $definitionTitle, $latestRevision )->getText();
912917
913918 if ( $oldtext === $newtext ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r101981Followup r101980 - replacing fatal by warning wasn't the ultimate goalnikerabbit12:01, 4 November 2011

Status & tagging log