Page MenuHomePhabricator

MediaWiki:Edittools is broken on the French Wikiversity
Closed, ResolvedPublic

Description

Hello,

To reproduce the bug, edit the wikicode of any French Wikiversity page, select "Math" in the EditTools and click on "≠".

More precisely, someone has brought my attention on a MediaWiki:Edittools bug: <charinsert> doesn't insert anything anymore, it's just moving the screen by adding a # at the end of the URL.

So I've copied the complete French Wikipédia page in replacement of the whole Wikiversity one and it was worst: the first line was repaired but everything else was hidden (<div id="specialcharsets">). I couldn't find anything to explain this phenomena in the two sites MediaWiki namespace pages.

Then, I've replaced this id by the old Wikiversity one (<div id="specialchars">) and the drop-down menu was back, but:

  • the <span> tags into <div id="specialchars"> don't provide any clickable link.
  • with <charinsert> instead of <span>, the bug had persisted.

https://fr.wikiversity.org/w/index.php?title=MediaWiki%3AEdittools&type=revision&diff=692713&oldid=692447

Event Timeline

Cannot reproduce:

I go to https://fr.wikiversity.org/w/index.php?title=Autisme_Comment_contribuer_vous_aussi_%3F&action=edit&debug=true
I choose "Mathematiques" in the EditTools dropdown at the bottom
I click on "≠".
The character is correctly inserted.

Please describe what exactly "is broken" (by describing both the actual outcome and the expected outcome).

If this has to do with custom scripts, see https://www.mediawiki.org/wiki/Help:Locating_broken_scripts for more information.

OK, as this is working with &debug=true but still not without it, I'm going to follow this process...

Herewith my second diagnosis:

  • On Chrome, there isn't any bug.
  • On Firefox, the bug occurs systematically (but never with debug=true), logged or not, and there isn't any JS error in the console (debug or not). Given the fact that the IDs specialchars & specialcharsets are native and not erased in the site CSS and JS pages, I can't figure out how to resolve this quickly and properly.

I suspect that on-wiki code which generates the pretty dropdown ends up somehow removing event handlers belonging to the CharInsert extension from the links, making them do nothing. (It's surprisingly easy to do.) It might not occur in debug mode or in other browsers depending on the order in which the two are executed (if dropdown generation runs before CharInsert, it's okay, otherwise it's not).

matmarex claimed this task.

I made this edit: https://fr.wikiversity.org/w/index.php?title=MediaWiki:Common.js&diff=prev&oldid=692871

Now the special characters links under the "Mathématiques" section using <charinsert> work for me.

I have no idea how the MediaWiki:Edittools entries using <span> instead of <charinsert> are supposed to work. Perhaps they are meant to just be copy-pasted? I suggest you just change those to <charinsert>.