Page MenuHomePhabricator

Links with query string replaced by "veaction=editsource" even for "action=history" and "action=purge"
Closed, InvalidPublic


On the french Wikipédia, the template documentation module displays 4 links in the header : "voir" (see), "modifier" (edit), "historique" (history) and "purger" (purge). When the 2017 wikitext editor is toggled on, the link to the latter 3 has its query string replaced from respectively "action=edit", "action=history" and "action=purge" to "veaction=editsource". While this is OK for the "edit" action, the other two links end with incorrect targets.

You can check out this behavior on any model with a documentation, e.g. this page, but this behavior does not appear on pages that are never edited with the 2017 editor, e.g. modules that use a different editor.

I was unable to find information about wheather the URL is generated differently or edited at some point, but I have two guesses:

  • The title.fullUrl() Lua function returns a different URL (this is a weak guess as the "historique" link used to be in the footer and work correcty at that time, so the function seems to return the correct URL),
  • The page is somehow parsed before display and URLs are edited to match the requirements of the 2017 wikicode editor, and at some point, the three consecutive links are changed but all the three are changed to an edit action regardless of the actual requested action.

I may also be totally wrong and the error comes from the Documentation module itself, but after a few tries in sandbox and searches in Lua Reference Manual, these are my best guesses and I fail to see any other possible origin.

Event Timeline

Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald Transcript
Od1n closed this task as Invalid.EditedApr 26 2020, 2:35 AM
Od1n added a subscriber: Od1n.

Closing, as it was a mistake on the wiki actually. Refs the discussion, and the fix I have applied (removal of the inappropriately used mw-editsection class).

update: I've just improved the fix :)