Last modified: 2014-07-08 00:07:45 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 T48582, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46582 - ResourceLoader: Implied global function not a global function outside debug mode
ResourceLoader: Implied global function not a global function outside debug mode
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-26 21:12 UTC by Mark A. Hershberger
Modified: 2014-07-08 00:07 UTC (History)
3 users (show)

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


Attachments

Description Mark A. Hershberger 2013-03-26 21:12:58 UTC
From https://bugzilla.mozilla.org/show_bug.cgi?id=854395

To test a minimization problem, I created a page in the sandbox.  This resulted in a JS error when clicking "show" (preventing the toggle from working).  Adding &debug=true to the URL -- to stop JS minimization -- allows the toggle to work without an error.

https://www.mediawiki.org/w/index.php?title=Project:Sandbox&oldid=664164

https://www.mediawiki.org/w/index.php?title=Project:Sandbox&oldid=664164&debug=true
Comment 1 Krinkle 2013-03-26 21:17:23 UTC
This has nothing to do with minification.

Class "collapsible" is something that is handled by a community maintained gadget. A gadget that is several years old having many (mostly unmaintained) copies on many wikis.

It has been failing on various wikis where the old version is still used that assumes the legacy loading method where everything is a global variable.

The reason it works in debug mode is because in debug mode the scripts are loaded via <script> in the global scope.

The solution is to either:

* Upgrade your copy of the community-maintained "collapsible" gadget on your wiki.

* Use mw-collapsible instead (which is handled by jquery.makeCollapsible).
Comment 3 Mark A. Hershberger 2013-03-26 22:50:37 UTC
Thank you!
Comment 4 Mark A. Hershberger 2013-03-26 23:15:15 UTC
The old installation of wiki.mozilla.org did not have the Gadgets extension installed, so it didn't use the old gadget.  The new Gadget would work as would mw-collapsible.  Ideas?
Comment 5 Krinkle 2013-03-26 23:16:22 UTC
(In reply to comment #4)
> The old installation of wiki.mozilla.org did not have the Gadgets extension
> installed, so it didn't use the old gadget.  The new Gadget would work as
> would mw-collapsible.  Ideas?

If they don't have the Gadgets extension installed they likely have it in their Common.js, so upgrade it there instead.
Comment 6 Krinkle 2013-03-26 23:20:02 UTC
(In reply to comment #4)
> The old installation of wiki.mozilla.org did not have the Gadgets extension
> installed, so it didn't use the old gadget.  The new Gadget would work as
> would mw-collapsible.  Ideas?

If they don't have the Gadgets extension installed they likely have it in their
Common.js, so upgrade it there instead.

(Quoting comment #1)
> The solution is to either:
> 
> * Upgrade your copy of the gadget on your wiki.
> 
> * Use mw-collapsible instead (which is handled by jquery.makeCollapsible).

In their case, since they have a lot of existing pages with "collapsible", is probably best to upgrade it and from now no slowly migrate to using mw-collapsible instead.

Alternatively if they don't mind not having collapsible tables on old pages (it's only a minor enhancement) they could decide to simply remove the old broken code from their Common.js and just use core's mw-collapsible from now on.

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


Navigation
Links