Page MenuHomePhabricator

RL modules specifying 'position' => 'bottom' aren't loading
Closed, ResolvedPublic

Description

The problem is in SkinMobile.php. 'position' => 'top' modules are packed into the $headModuleNames array and 'position' => 'bottom' are packed into $moduleNams. $headModuleNames are loaded properly and without fanfare, but there is some code hacking around ResourceLoader with $moduleNames (grep for '$bottomScripts') that (as far as I can determine) only works for 'raw' modules.


Version: unspecified
Severity: normal
URL: http://www.mediawiki.org/wiki/Manual:$wgResourceModules
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=44070

Details

Reference
bz44072

Event Timeline

bzimport raised the priority of this task from to Needs Triage.
bzimport set Reference to bz44072.
bzimport added a subscriber: Unknown Object (MLST).
ori created this task.Jan 17 2013, 7:04 PM
ori added a comment.Jan 17 2013, 7:08 PM

Specifically I think this would only work for 'raw' scripts since it bypasses most of ResourceLoader:

			$bottomScripts = Html::inlineScript(
				ResourceLoader::makeLoaderConditionalScript(
					Xml::encodeJsCall( 'mw.loader.load', array( $moduleNames ) )
				)
			);

Two things going on here:

  1. https://gerrit.wikimedia.org/r/#/c/47193/ will make the bottom scripts behave well
  1. Modules in EventLogging need to declare themselves as having target mobile - currently $headLinks[] = $this->resourceLoaderLink( $headModuleNames, 'scripts' ); ignores the target property - this is a bug and needs to be fixed.

(see getTargets function in ResourceLoaderModule)

ori added a comment.Feb 2 2013, 6:56 PM

(In reply to comment #2)

  1. Modules in EventLogging need to declare themselves as having target mobile

Gerrit change 47206 (merged) adds 'mobile' to targets EventLogging modules.

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptJan 28 2016, 6:07 PM