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.Nov 22 2014, 1:21 AM
bzimport set Reference to bz44072.
bzimport added a subscriber: Unknown Object (MLST).

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)

(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.