Page MenuHomePhabricator

Write a page explaining how to locate a broken script/gadget
Closed, ResolvedPublic

Description

Event Timeline

Elitre created this task.Apr 21 2017, 10:04 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 21 2017, 10:04 AM

The stock answer I normally use when trying to help people track down issues:

Could you please open your web browser's developer tools? After opening them, please append ?debug=true to the address of the page on which you see the problem, if the address does not already include a ?. (If the address already includes a ?, append &debug=true instead - more information).
If there is a problem or an error with JavaScript it should be printed in the 'console' of the developer tools and should also tell you the name of the file. Often JavaScript errors are a reason for problems, or a non-existing file called from another file (which can be seen in the 'network' tab).
For more information please see:

Maybe helpful...

There's the new safemode thing as well.

Elitre triaged this task as Lowest priority.Apr 26 2017, 5:10 PM
Aklapper added a comment.EditedMay 10 2017, 11:36 AM

Tried to write a short text but afterwards realized that the steps in https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)/Archive_154#Guide:_How_to_find_which_scripts_are_actually_broken are already pretty good plus include a video.

Anyway, feel free to use. Only about tracking down and where to fix, not how to fix. For how to fix, see e.g. https://phabricator.wikimedia.org/T164242 or the en.wp link above.


If you have problems with local gadgets or user scripts, these problems are often created by broken JavaScript code (the programming language that gadgets are written in) or undeclared dependencies on other code.

To track down the problematic code and place that needs fixing, open the developer tools of your web browser:

After opening them, please append ?debug=true to the web address (URL) of the page on which you see the problem, if the URL does not already include a ?. If the URL already includes a ?, append &debug=true instead. (For more technical information you can check https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader#Toggle_debug_mode but you do not have to read that to follow the next steps.)

If there is a problem with JavaScript, an error should be printed in the 'console' of the developer tools (make sure that "JavaScript" or "JS" is enabled here, and potentially disable other output so the output does not get too noisy):


Click on the file name on the right. This will open the "Debugger" view. The right pane will show the code which needs to be fixed. The left pane will show which file needs to be fixed (you might need to scroll through the list to find the one file that is highlighted). Right-click on the file, to open the file that needs fixing in a new tab:

Due to how files are "loaded", the exact URL of the file might not always be obvious. So you may have to scroll to the top of the file to see its name.

Problems that need fixing could be in the local MediaWiki:Common.js file on that wiki, in your personal files such as User:MyUserName/common.js (or other .js files that you have under User:MyUserName/), or in the code of one of the gadgets available on that wiki, or in the code dependency definitions of the gadget defined in MediaWiki:Gadgets-definition on that wiki.

Trizek-WMF added a subscriber: Trizek-WMF.EditedMay 10 2017, 5:39 PM

We don't have a place to post this on MediaWiki wiki and we can't drop it on wiki like this. I'm sad.

Any suggestions on a page name at mw.org?

This comment was removed by Trizek-WMF.

I kind of like option (b), on the grounds that the support desk probably needs to use this page.

Option (a) requires CC-0 licensing, which means that only @SoWhy could add that great description from VPT's archives.

SoWhy added a comment.May 10 2017, 6:31 PM

Option (a) requires CC-0 licensing, which means that only @SoWhy could add that great description from VPT's archives.

Unsure what you need exactly but if it's a licensing issue, you can use my stuff with any license you want (I hereby declare those videos I made and posted on en-wiki's VPT page public domain)

I add that user will probably need to clear local browser cache if he add &debug or &safemode.

@Framawiki: Did you maybe mean "bypass", or really "clear"? Because I've never cleared my browser cache here...

Yes, bypass (ctrl+f5). I just say this because I forgot to do it for T164908. Thanks.

Trizek-WMF added a subscriber: Whatamidoing-WMF.

Andre and I still see many debugging requests on the wikis (or have come directly), so I'm working on this page in the hackathon. I'm also using it as an example for how to mark a page for translation.

https://www.mediawiki.org/wiki/Help:Locating_broken_scripts

Trizek-WMF reassigned this task from Trizek-WMF to Aklapper.May 21 2017, 1:23 PM
Trizek-WMF raised the priority of this task from Lowest to Normal.

The page has been set. It is not perfect, but it is already possible to identify the problem and have ideas how to fix them temporary by disabling or commenting the scripts. The page is ready for translation.
Improvements for more advances fixes or cases should be done in subpages.

Andre, as we discussed, your turn to review the doc and see possible improvements. :)

(+ raising the priority to reflect the fact that communities have troubles and we may have more troubles soon due to new depreciated elements.)

While the page hasn't been edited since a while, I'll send a message to translators soon, unless if @Aklapper says no. :)

Aklapper closed this task as Resolved.Jun 1 2017, 11:19 AM

Added one more sentence in https://www.mediawiki.org/w/index.php?title=Help%3ALocating_broken_scripts&type=revision&diff=2479138&oldid=2478770 linking to some how-to-fix info/links in T164242, as I don't have the time to write the prosa myself (plus would be duplication).

Boldly setting task to resolved. Thanks everybody!

Page sent to translators and ambassadors.

Qgil awarded a token.Jun 2 2017, 1:09 AM