Steps to replicate the issue (include links if applicable):
- Open visual editor
- Click any button on the toolbar
- Page not found: /w/undefined
MilkyDefer | |
Dec 1 2023, 3:02 AM |
Unknown Object (File) | |
Dec 1 2023, 2:10 PM |
F41550192: undefined.mp4 | |
Dec 1 2023, 3:02 AM |
Steps to replicate the issue (include links if applicable):
I tried using visual editor in Japanese and Korean Wikipedia and found no problems. I think it is safe to assume that this is another Chinese-exclusive problem.
As with previous experiences with Chinese language-exclusive problems, @Winston_Sung do you have any idea?
The problem may not appear when safe mode is activated. That means this is most likely a local gadget issue. Sorry for casting doubt on the translation team.
This is caused by an on-wiki gadget: https://zh.wikipedia.org/w/index.php?title=MediaWiki%3AGadget-VariantAlly.js&diff=79927662&oldid=79892477
@Jdlrobson's edit fixed it throwing exception but caused it to return undefined, causing more breakage.
As the maintainer of the gadget I suggest change line 140:
} catch (e) { return; // <-- here }
into:
} catch (e) { return link; }
and link 213:
var anchor_1 = target.closest('a');
into
var anchor_1 = target.closest('a[href]');
Appears to the VariantAlly script: https://github.com/wikimedia-gadgets/VariantAlly/issues/4
This still sets an href, it just sets the href to the current page. Now click on OOUI tools reload the page. The fix to the library (https://github.com/wikimedia-gadgets/VariantAlly/pull/5) should cause it to skip over non-href <a> tags.
I've applied my own fix with @disksance 's blessing and things appear to be working now.