r76265 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76264‎ | r76265 | r76266 >
Date:20:06, 7 November 2010
Author:mkroetzsch
Status:deferred
Tags:
Comment:
Improve ResourceLoader compatibility for extensions that use SMW's existing (MW <= 1.16) resource loading mechanism: to become compatible with MW 1.17, extensions should:
(1) register their own resource loader modules as done for SMW in ./SMW.hooks.php,
(2) continue to use srfRequireHeadItem() but changing the IDs used there for resources (first parameter) to match the IDs of the resource loader modules created in step (1).
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_Outputs.php
@@ -59,9 +59,7 @@
6060 return self::requireHeadItemOld( $id, $item );
6161 }
6262
63 - if ( is_numeric( $id ) ) {
64 - global $wgOut;
65 -
 63+ if ( is_numeric( $id ) ) { // compatibility with older extensions; eventually the numeric constants should vanish
6664 switch ( $id ) {
6765 case SMW_HEADER_TOOLTIP:
6866 self::requireResource( 'ext.smw.tooltips' );
@@ -74,9 +72,8 @@
7573 break;
7674 }
7775 }
78 - else {
79 - // This should not be used anymore; use the RL directly.
80 - self::$mHeadItems[$id] = $item;
 76+ else { // normal case: treat ID as a ResourceLoader ID
 77+ self::requireResource( $id );
8178 }
8279 }
8380
@@ -217,4 +214,4 @@
218215 self::$mHeadItems = array();
219216 }
220217
221 -}
\ No newline at end of file
 218+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r76884Partial revert of r76265, which broke backard compatibilityjeroendedauw13:59, 17 November 2010

Status & tagging log