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

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
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
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Krinkle
: 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: ---

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

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 ) {

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