I run a MediaWiki site which uses the Topbar extension. I recently upgraded the installation to the bleeding edge version from MediaWiki's master branch: version 1.28.0-alpha (91e56cc).
Afterwards, the Topbar extension no longer works:
- Usually, the topbar div is not inserted at all.
- Occasionally, the topbar div appears but the links are nonfunctional.
The latter issue may be a problem with my CSS (I do not know), but the intermittent behavior concerns me. So the first order of business is to make sure the topbar div at least appears every time.
This extension is just a small javascript that is supposed to run when the page loads, to add a chunk of HTML near the top (<div id="mw-writh-topbar" ...>
). It does so using a jQuery function.
Unfortunately, I am not really a web developer, so even this simple routine is a bit over my head.
Here's what I do know:
- There are no 500 server errors, no overt problem with the PHP.
- At some point early in my investigation, the developer console sometimes complained about
Uncaught ReferenceError: jQuery is not defined
, but I cannot reproduce it anymore now. Research vaguely suggested it could be because the extension does not use the new ResourceLoader mechanism, so I tried to migrate Topbar to use the ResourceLoader mechanism (viamaintenance/convertExtensionToRegistration.php
, and thenwfLoadExtension('Topbar')
inLocalSettings.php
) but it did not seem to make any difference. - The Topbar hooks seem to be called, because
css/Topbar.css
gets added to the page. But I have no clue whetherjs/Topbar.js
ever runs, and if so, what happens.
So: how can I debug this?