r78501 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78500‎ | r78501 | r78502 >
Date:18:09, 16 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added MediaWiki version checks around wfLoadExtensionMessages(), so that it's only called for MW < 1.16
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormInputs.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.php
@@ -901,7 +901,9 @@
902902 // default to false - no need to check if it matches a 'false' word
903903 $vlc = strtolower( trim( $cur_value ) );
904904 // manually load SMW's message values, if they weren't loaded before
905 - wfLoadExtensionMessages( 'SemanticMediaWiki' );
 905+ if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 906+ wfLoadExtensionMessages( 'SemanticMediaWiki' );
 907+ }
906908 if ( in_array( $vlc, explode( ',', wfMsgForContent( 'smw_true_words' ) ), TRUE ) ) {
907909 $checked_str = ' checked="checked"';
908910 } else {
Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -751,7 +751,9 @@
752752 if ( count( $cur_value ) == 1 ) {
753753 // manually load SMW's message values here, in case they
754754 // didn't get loaded before
755 - wfLoadExtensionMessages( 'SemanticMediaWiki' );
 755+ if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 756+ wfLoadExtensionMessages( 'SemanticMediaWiki' );
 757+ }
756758 $words_for_false = explode( ',', wfMsgForContent( 'smw_false_words' ) );
757759 // for each language, there's a series of words that are
758760 // equal to false - get the word in the series that matches
@@ -766,7 +768,9 @@
767769 }
768770 $cur_value_in_template = $no;
769771 } elseif ( count( $cur_value ) == 2 ) {
770 - wfLoadExtensionMessages( 'SemanticMediaWiki' );
 772+ if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 773+ wfLoadExtensionMessages( 'SemanticMediaWiki' );
 774+ }
771775 $words_for_true = explode( ',', wfMsgForContent( 'smw_true_words' ) );
772776 // get the value in the 'true' series that tends to be "yes",
773777 // and go with that one - generally, that's the third word

Status & tagging log