Page MenuHomePhabricator

Collection: bookcreator.js fails when using Resource Loader
Closed, ResolvedPublic

Description

The Collection extension has a feature that when book creation is active, the user can hover over any wiki link and a popup will appear offering to add the linked page to the current book.

This feature is currently broken (using up-to-date phase3 and collection checkouts from svn). I strongly suspect that the introduction of the ResourceLoader broke this extension.

The errors in the Chromium console are:

Uncaught ReferenceError: jQuery is not defined /w/extensions/Collection/js/jquery.json.js?8:17

Uncaught ReferenceError: $ is not defined /w/extensions/Collection/js/jstorage.js?8:53

Uncaught ReferenceError: jQuery is not defined /w/extensions/Collection/js/bookcreator.js?8:22

The Collection extension asks for JQuery by calling $wgOut->includeJQuery();
but can't find it afterwards (Collection.hooks.php:257). After changing this code so the Collection extension uses its own JQuery library (which comes bundled with the extension), the error above go away, but there is a new error:

Uncaught ReferenceError: wgServer is not defined
/w/extensions/Collection/js/bookcreator.js?8:24

IMHO this should be fixed before the Resource Loader is deployed on Wikimedia sites.


Version: unspecified
Severity: normal

Details

Reference
bz26197

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:12 PM
bzimport added a project: Collection.
bzimport set Reference to bz26197.

I should add that the rest of the Collection extension (adding pages, exporting PDFs etc.) works correctly. The code is live on http://spiele.j-crew.de, so you can also look at the generated HTML.

johannes.beigel wrote:

Thanks a lot! I've committed a few small changes in r77576 which fixes the problems for me.