Last modified: 2011-03-06 01:48:12 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 T29880, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27880 - Uncaught ReferenceError: addOnloadHook is not defined
Uncaught ReferenceError: addOnloadHook is not defined
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CodeReview (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-05 22:27 UTC by Sam Reed (reedy)
Modified: 2011-03-06 01:48 UTC (History)
4 users (show)

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


Attachments

Description Sam Reed (reedy) 2011-03-05 22:27:10 UTC
When clicking reply to a message on CR, we get a "Uncaught ReferenceError: addOnloadHook is not defined"

Noticed by bawolff on IRC
Comment 1 Krinkle 2011-03-05 22:50:15 UTC
Will check it out next week.
Comment 2 Bawolff (Brian Wolff) 2011-03-05 22:51:17 UTC
/me tried to fix it with http://pastebin.com/9ysSpjgh but was told that is not the proper way to do such things.
Comment 3 Krinkle 2011-03-05 22:55:44 UTC
Console says source of problem is:

<script type="text/javascript">addOnloadHook(function(){document.getElementById('wpReplyTo14667').focus();});</script>

These scripts should not be inline as mediawiki modules are not available untill the end of the page.
Comment 4 Sam Reed (reedy) 2011-03-05 22:57:04 UTC
<RoanKattouw> The right way would be to add the following code to codereview.js or its equivalent:
<RoanKattouw> Or wait, we don't have $id on the client side, it'd need to be exported

(before you came in)
Comment 5 Krinkle 2011-03-06 01:48:12 UTC
Fixed in r83352.

Removed inline scripting and added to core module instead. using the class intead of the $id.

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


Navigation
Links