Page MenuHomePhabricator

Clicking on "edit source" beside a section open the visual editor on the French Wiktionary (due to broken local gadget)
Closed, InvalidPublic

Description

If one clicks on "edit source" next to a section, it opens the visual editor. You can test here. Note that it open the source editor if one clicks on "edit source" tab on the top of the page.

It happens only if "Show me both editor tabs" has been selected in the preferences (if one select "Always give me the source editor", one only get the source editor).

If you read French, you can see this discussion.

Event Timeline

Pamputt created this task.Jun 7 2019, 5:35 PM
Pamputt updated the task description. (Show Details)Jun 7 2019, 5:38 PM
Pamputt renamed this task from Clicking on "edit source" for a section open the visual editor on the French Wiktionary to Clicking on "edit source" beside a section open the visual editor on the French Wiktionary.Jun 7 2019, 5:44 PM

Yes, this was announced in this week's Tech/News:

Certains wikis comportent un onglet pour l’éditeur visuel et un autre pour un éditeur de wikicode. D’autres wikis ne comportent qu’un seul onglet. Si votre wiki comporte deux onglets, cliquer sur un lien pour créer une nouvelle page a toujours ouvert un éditeur de wikicode. À partir de maintenant, c’est le dernier éditeur que vous avez utilisé qui s’ouvrira.

It is controlled by your preferences:

See T223793.

Just to be clear, we have two link: "Edit" and "Edit source". Clicking on "Edit" or "Edit source" beside a section always opens the Visual Editor (I expect that clicking on "Edit source" opens the wikicode editor). However, if one clicks on "Edit" in the tab on the top of the page, it will open the Visual Editor (as expected) and clicking on "Edit source" will open the wikicode editor (as expected).

VisualEditor produces the correct output:

<h3><span class="mw-headline" id="Nom_commun"><span class="titredef" id="fr-nom-1">Nom commun</span><span id="fr-nom" style="font-size:0;"> </span></span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=graffiti&amp;veaction=edit&amp;section=3" class="mw-editsection-visualeditor" title="Modifier la section : Nom commun">modifier</a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=graffiti&amp;action=edit&amp;section=3" title="Modifier la section : Nom commun">modifier le wikicode</a><span class="mw-editsection-bracket">]</span></span></h3>

Note that one of the links uses action=edit and the other veaction=edit.

The incorrect result is caused by this script: https://fr.wiktionary.org/wiki/MediaWiki:Gadget-clearer-edit-summary.js which overrides both links to use the same href as the first link.

Aklapper renamed this task from Clicking on "edit source" beside a section open the visual editor on the French Wiktionary to Clicking on "edit source" beside a section open the visual editor on the French Wiktionary (due to broken local gadget).Jun 7 2019, 9:18 PM
Aklapper removed a project: Wiktionary.

Removing Wiktionary, please see its project description.

Aklapper closed this task as Invalid.Jun 7 2019, 9:19 PM

Closing task as invalid as local on-wiki content is out of scope for Phabricator.

For the record, I think the issue is entirely unrelated to the VE change and announcement @Jdforrester-WMF linked. It just happened at a very similar time – the gadget was enabled by default on 29 May (https://fr.wiktionary.org/w/index.php?title=MediaWiki:Gadgets-definition&diff=26346723&oldid=26262440) and the issue was reported on 3 June (on-wiki), while the VE change was deployed on 5 June.

The on-wiki discussion also mentions the order of links changing, which actually was an unintended consequence of the linked VE change, as described here: T223793#5215178. The tabs were in the wrong order from May 24 to May 28. I apologize, the order shouldn't change again.

I don't speak French (I used automatic translation to skim your discussion), so I'd appreciate if you could forward this reply to the on-wiki discussion :)

Oops, sorry for the noise. Thank you very much for the investigation of our problem. We will fix it on our wiki.

For fixing the gadget, I would recommend changing the following two lines near the end:

		var section_edit_link = $(this).find('a');
		section_edit_link.attr('href', section_edit_link.attr('href') + '&summary=' + summary);

…to instead be:

		// When "Show me both editor tabs" enabled, there will be two links: visual and wikitext
		var section_edit_links = $(this).find('a');
		section_edit_links.attr('href', function(i, href) {
			return href + '&summary=' + summary;
		});

Thank you matmarex, you've solved it for good.