r76781 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76780‎ | r76781 | r76782 >
Date:06:19, 16 November 2010
Author:yaron
Status:deferred (Comments)
Tags:
Comment:
Added call to SMWOutputs::requireHeadItem() for loading SMW JS, for MW < 1.17; fix for bug 25884
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -197,8 +197,13 @@
198198 $scripts = array();
199199 if ( !$sfgUseFormEditPage )
200200 $scripts[] = "$sfgScriptPath/libs/SF_ajax_form_preview.js";
201 - $scripts[] = "$smwgScriptPath/skins/SMW_tooltip.js";
202 - $scripts[] = "$smwgScriptPath/skins/SMW_sorttable.js";
 201+ if ( method_exists( 'SMWOutputs', 'requireHeadItem' ) ) {
 202+ SMWOutputs::requireHeadItem( SMW_HEADER_TOOLTIP );
 203+ SMWOutputs::requireHeadItem( SMW_HEADER_SORTTABLE );
 204+ } else {
 205+ $scripts[] = "$smwgScriptPath/skins/SMW_tooltip.js";
 206+ $scripts[] = "$smwgScriptPath/skins/SMW_sorttable.js";
 207+ }
203208 if ( method_exists( 'OutputPage', 'includeJQuery' ) ) {
204209 $wgOut->includeJQuery();
205210 } else {

Comments

#Comment by Jeroen De Dauw (talk | contribs)   22:21, 17 November 2010

Should you not be using SMWOutputs::requireHeadItem in both cases? Then SF won't break if SMW has internal refactoring that affects the path of these files.

Status & tagging log