Page MenuHomePhabricator

Extension:OnlineStatus reference error - undefined hookevent
Closed, DeclinedPublic

Description

I am running MediaWiki 1.28.0 and using Google Chrome, under the developer's JavaScript console, a warning for hookEvent being depreciated was targeted towards Skin:Vector. The warning is listed as follows exactly:

Use of "hookEvent" is deprecated. Use jQuery instead - load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0pwu4rh:15


Update: FireFox console now gives a reference error instead of a warning for the undefined hookevent

Exception in module-execute in module ext.onlineStatus:
ReferenceError: hookEvent is not defined ReferenceError: hookEvent is not defined

Event Timeline

The URL in the error message is misleading. The error almost certainly comes from your site JavaScript (the pages 'MediaWiki:Common.js' and 'MediaWiki:Vector.js'), especially if you copied them from Wikipedia a long time ago. Vector doesn't use the hookEvent function.

Aklapper changed the task status from Open to Stalled.May 17 2017, 2:37 PM

@SpookyGhost8: Is this a public wiki that you could link to?
Could you please use the debug=true URL parameter to load the page which shows that problem, to isolate in the browser's developer tools which exact file is creating the issue?

@matmarex @Aklapper The same warning appears throughout the wiki (http://www.hypoverse.com). Removing everything from MediaWiki:Common.js, resulted in same above error message. I already checked if there was something missing from load.php, there was none compared to MediaWiki 1.28.2. Is it possible that something is corrupted, the domain was canceled and later reactivated a few weeks later?

I don't see any warnings when viewing the site.

I don't see any warnings when viewing the site.

ok, now that the cache finally cleared away; I don't see the warning either. The original JavaScript was copied from www.dkwiki.com or http://wow.gamepedia.com and there are no errors there. The only extra code i added was to append a template to the bottom of each page:

$(document).ready(function() {
    var newSection = '<div id="disclaimer">' + '</div>';
    $('ul#footer-places').after(newSection);
    $.getJSON('/w/api.php?action=parse&text={{Disclaimer}}&format=json', function(data) {
        var code = data.parse.text['*'];
        $('ul#footer-places').append(code);
    });
});

It appears the warning is triggered due to that and the current count down timer. Despite no call to hookEvent.

Aklapper changed the task status from Resolved to Invalid.May 17 2017, 10:08 PM

Issue cannot be reproduced by anyone anymore hence closing task.

@Aklapper actually logging in causes it with or without any JavaScript in common.js. I now deleted MediaWiki:common.js and there is no other JavaScript running. Hence I reopened this task for bug consideration.

Aklapper changed the task status from Open to Stalled.May 18 2017, 8:06 AM
Aklapper removed a project: Vector (legacy skin).

Please see T165552#3271282 and/or please provide a public testcase.

I wanted to check it out again but your wiki (http://www.hypoverse.com/) seems to be down…

I wanted to check it out again but your wiki (http://www.hypoverse.com/) seems to be down…

Try this link: http://www.hypoverse.com/wiki/Main_Page

Please see T165552#3271282 and/or please provide a public testcase.

Ok, I have allowed the creation of new accounts for temporary measures so you can see for yourself. I will be removing this in a few days.

The hookEvent call and the warning is coming from the OnlineStatus extension you have installed.

The hookEvent call and the warning is coming from the OnlineStatus extension you have installed.

Thanks and I can confirm this by disabling OnlineStatus extension and the warning went away. Is there another extension that could be substituted for now? Seems to be generated by the following in OnlineStatus.js:

hookEvent( 'load', OnlineStatus );
Aklapper renamed this task from Vector Skin - warning on depreciated hookEvent to OnlineStatus extension shows warning on deprecated hookEvent.May 20 2017, 10:57 AM
Aklapper changed the task status from Stalled to Open.

Now under MediaWiki 1.29.2, FireFox console tells me

Exception in module-execute in module ext.onlineStatus:
ReferenceError: hookEvent is not defined ReferenceError: hookEvent is not defined

If I disable Extension:OnlineStatus, it goes away

SpookyGhost8 renamed this task from OnlineStatus extension shows warning on deprecated hookEvent to Extension:OnlineStatus reference error - undefined hookevent.Dec 24 2017, 12:56 AM