r73526 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73525‎ | r73526 | r73527 >
Date:13:40, 22 September 2010
Author:catrope
Status:deferred
Tags:
Comment:
SimpleSurvey: Fix breakage caused by PrefSwitch being moved with a horrible hack detecting which path to use
Modified paths:
  • /trunk/extensions/SimpleSurvey/SimpleSurvey.php (modified) (history)
  • /trunk/extensions/SimpleSurvey/SpecialSimpleSurvey.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SimpleSurvey/SimpleSurvey.php
@@ -3,7 +3,11 @@
44 $dir = dirname( __FILE__ ) . '/';
55
66 // from prefswitch in usability initiative
7 -$prefswitchdir = dirname( dirname( __FILE__ ) ) . "/UsabilityInitiative/PrefSwitch";
 7+$prefswitchdir = dirname( dirname( __FILE__ ) ) . "/PrefSwitch";
 8+// Horrible back for back compat with pre-r73480 installs
 9+if ( !is_dir( $prefswitchdir ) ) {
 10+ $prefswitchdir = dirname( dirname( __FILE__ ) ) . "/UsabilityInitiative/PrefSwitch";
 11+}
812
913 // Use this to override the URL of ext.prefSwitch.{js,css} if needed
1014 $wgSimpleSurveyJSPath = null;
Index: trunk/extensions/SimpleSurvey/SpecialSimpleSurvey.php
@@ -91,10 +91,10 @@
9292
9393 global $wgExtensionAssetsPath, $wgSimpleSurveyJSPath, $wgSimpleSurveyCSSPath;
9494 $script = Html::linkedScript( wfAppendQuery( $wgSimpleSurveyJSPath ? $wgSimpleSurveyJSPath :
95 - "$wgExtensionAssetsPath/UsabilityInitiative/PrefSwitch/modules/ext.prefSwitch.js", $wgPrefSwitchStyleVersion ) );
 95+ "$wgExtensionAssetsPath/PrefSwitch/modules/ext.prefSwitch.js", $wgPrefSwitchStyleVersion ) );
9696 $wgOut->addScript( $script );
9797 $wgOut->addExtensionStyle( wfAppendQuery( $wgSimpleSurveyCSSPath ? $wgSimpleSurveyCSSPath :
98 - "$wgExtensionAssetsPath/UsabilityInitiative/PrefSwitch/modules/ext.prefSwitch.css", $wgPrefSwitchStyleVersion ) );
 98+ "$wgExtensionAssetsPath/PrefSwitch/modules/ext.prefSwitch.css", $wgPrefSwitchStyleVersion ) );
9999
100100 // Handle various modes
101101 $renderedSurvey = $this->render( $wgRequest->getVal( "survey" ) );

Status & tagging log