r98779 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98778‎ | r98779 | r98780 >
Date:17:29, 3 October 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Fix for this fatal:
PHP Fatal error: Call to a member function getText() on a non-object in /www/w/extensions/Translate/utils/TranslationHelpers.php on line 896
Modified paths:
  • /trunk/extensions/Translate/README (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationHelpers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/README
@@ -29,6 +29,9 @@
3030 http://translatewiki.net/docs/Translate/html/
3131
3232 == Change log ==
 33+* 2011-10-03
 34+- Fixed an error that sometimes prevented translating messages that had
 35+ been renamed
3336 * 2011-10-01
3437 - Changed index on translate_sections database table
3538 - Fixed escaping in PythonSingleFFS parser
Index: trunk/extensions/Translate/utils/TranslationHelpers.php
@@ -888,12 +888,13 @@
889889
890890 $latestRevision = $definitionTitle->getLatestRevID();
891891
892 - $translationRevision = $db->selectField( 'revtag', 'rt_value', $conds, __METHOD__, $options );
 892+ $translationRevision = $db->selectField( 'revtag', 'rt_value', $conds, __METHOD__, $options );
893893 if ( $translationRevision === false ) {
894894 return null;
895895 }
896896
897 - $oldtext = Revision::newFromTitle( $definitionTitle, $translationRevision )->getText();
 897+ // Using newFromId instead of newFromTitle, because the page might have been renamed
 898+ $oldtext = Revision::newFromId( $translationRevision )->getText();
898899 $newtext = Revision::newFromTitle( $definitionTitle, $latestRevision )->getText();
899900
900901 if ( $oldtext === $newtext ) {

Status & tagging log