Last modified: 2011-02-14 21:14:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29321, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27321 - Loading modules with a relative remote base path broken in debug mode
Loading modules with a relative remote base path broken in debug mode
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.18.x
All All
: Normal normal (vote)
: ---
Assigned To: Krinkle
http://translatewiki.net/wiki/Special...
:
: 27322 27372 (view as bug list)
Depends on:
Blocks: 26611
  Show dependency treegraph
 
Reported: 2011-02-11 08:44 UTC by Daniel Friesen
Modified: 2011-02-14 21:14 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Provisional fix to mediawiki.load (566 bytes, patch)
2011-02-12 01:37 UTC, Brion Vibber
Details

Description Daniel Friesen 2011-02-11 08:44:52 UTC
Something is wrong with the resource loader. Tabs are broken in Special:Preferences when resource loader is in debug mode, but not when debug mode is off.

I haven't examined it yet, but it's one of three things:
- The code isn't being loaded in debug mode
- Something broken in debug mode is stopping the code from executing
- Something broke whatever event is being used in debug mode
Comment 1 LordAndrew 2011-02-11 15:20:01 UTC
The search box, the editing toolbar, and probably other JavaScript stuff is also broken in debug mode. I tried hunting this down yesterday, but failed to discover the origin of the problem. I'll keep looking.
Comment 2 Brion Vibber 2011-02-12 01:23:21 UTC
I'll take a peek; I was poking at prefs recently.
Comment 3 Krinkle 2011-02-12 01:28:08 UTC
Not related to preference script. in trunk no javascript is loaded at all except for jquery and the module implementation calls.

The script that adds the individual <script> tags (mw.loader.load('/w/resources....') is not adding the tags.
Comment 4 Brion Vibber 2011-02-12 01:37:29 UTC
Created attachment 8130 [details]
Provisional fix to mediawiki.load

This fixes it for me, but I'm not sure it's the correct fix.

In debug mode, the loader chunks get replaced with attempts to load the specific URLs; however only module "names" beginning with 'http:' or 'https:' actually get loaded this way. Since we were receiving local urls like this:

  mediaWiki.loader.implement("mediawiki.legacy.mwsuggest", function( $, mw ) {
	mediaWiki.loader.load("/trunk/skins/common/mwsuggest.js");

they were getting added to a modules list and then just never work.

Checking also for module "names" that start with "/" and loading them as local URLs appears to work, but I'm not sure if it's wise. Should full URLs be used instead?
Comment 5 Brion Vibber 2011-02-12 01:46:07 UTC
Bug caused by regression in r81731; added a note on code review there to check whether reverting that or adding this is better fix.
Comment 6 Krinkle 2011-02-12 22:38:58 UTC
Changing summary of the bug to reflect the issue.

Checking the live site I see that resources from mediawiki.legacy and extensions are loaded fine, even in debug mode. Because those have $wgStylePath and $wgExtensionAssetsPath in front of them which, in case of Wikimedia, starts with http:// (http://bits.wikimedia.org/ ...etc. ) 

Since resources could point to a full url prefixing wgServer in all cases is not good. So Brion's suggestion in Code Review comments: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/81731#c14121 sounds like a good idea.
Comment 7 Krinkle 2011-02-12 22:47:38 UTC
Done in r82038.
Comment 8 Krinkle 2011-02-12 23:26:02 UTC
(changing assignee so I can easily find a bugs if I know that I fixed them with BugZilla's search engine)
Comment 9 Krinkle 2011-02-13 01:33:43 UTC
*** Bug 27372 has been marked as a duplicate of this bug. ***
Comment 10 Roan Kattouw 2011-02-14 21:14:51 UTC
*** Bug 27322 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links