Last modified: 2009-09-21 09:09:22 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 T22690, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 20690 - FlaggedRevs main (system) JavaScript variables suddenly at the end of the head tag, after MediaWiki:Common.js etc.; breaks scripts
FlaggedRevs main (system) JavaScript variables suddenly at the end of the hea...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
FlaggedRevs (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Aaron Schulz
http://de.wiktionary.org/wiki/Tor
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-17 13:27 UTC by Melancholie
Modified: 2009-09-21 09:09 UTC (History)
2 users (show)

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


Attachments

Description Melancholie 2009-09-17 13:27:03 UTC
Main (system) JavaScript variables suddenly at the end of the head tag, after MediaWiki:Common.js etc.
This recent change (occured with code update today) breaks efficient scripts that rely on variables like wgStableRevisionId on runtime/loadtime!

Example:
<script type="text/javascript">
var wgFlaggedRevsParams = {"tags": {"accuracy": 2}};
var wgStableRevisionId = 1068025;
var wgAjaxReview = {"sendingMsg": "Übertragung …", "sentMsgOk": "Markierung gesetzt ✔", "sentMsgBad": "Markierung konnte nicht gesetzt werden!", "actioncomplete": "Aktion beendet", "actionfailed": "Aktion fehlgeschlagen"}
</script>
<script type="text/javascript" src="/w/extensions/FlaggedRevs/flaggedrevs.js?60"></script>
</head>
Comment 1 Melancholie 2009-09-17 13:31:04 UTC
Variables: place them in front of the wikibits.js inclusion, they should at least be available for gadgets and following scripts.
Comment 2 Aaron Schulz 2009-09-17 15:58:17 UTC
Something in OutputPage.php changed the order it seems.
Comment 3 Brion Vibber 2009-09-17 18:32:22 UTC
We chatted briefly on this in IRC; current recommendation is to move the vars into the MakeGlobalVariablesScript hook so they'll show up in the main variable block, which is guaranteed to come before other JS inclusions.
Comment 4 Aaron Schulz 2009-09-17 19:12:11 UTC
Fixed in r56553
Comment 5 Melancholie 2009-09-21 09:09:22 UTC
Not quite sure, but shouldn't the line

<script type="text/javascript"
src="/w/extensions/FlaggedRevs/flaggedrevs.js?60"></script>

come directly after the core scripts? At the moment it comes last (</head>); maybe there is a reason for this, but if not it should be grouped with all the other core & extension scripts (like centralnotice.js e.g.).

See also bug 20720 ("Change script loading order back")

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


Navigation
Links