Page MenuHomePhabricator

Copy and pasting template shuffles parameter order
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Open two articles for editing using the visual editor.
  • Select a template node with many parameters (e.g., an infobox).
  • Copy and paste the template to the other article.

For example, the page Katina and the sandbox.

What happens?:
The order of parameters is shuffled (not necessary to save the page, it can be seen in the diff).

What should have happened instead?:
The order of parameters is preserved.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
1.39.0-wmf.4

Related: T216808, T285382

Event Timeline

matmarex subscribed.

As far as I can tell, VE is sending the template to Parsoid with parameters in a sensible order:

<!doctype html><html prefix="dc: http://purl.org/dc/terms/ mw: http://mediawiki.org/rdf/" about="https://cs.wikipedia.org/wiki/Special:Redirect/revision/21123250"><head prefix="mwr: https://cs.wikipedia.org/wiki/Special:Redirect/"><meta property="mw:TimeUuid" content="1e570310-b65f-11ec-b7a0-dd794093c378"><meta charset="utf-8"><meta property="mw:pageId" content="3008"><meta property="mw:pageNamespace" content="4"><link rel="dc:replaces" resource="mwr:revision/21122947"><meta property="mw:revisionSHA1" content="baa9d036275e467d96be5ebdee0048b0f00ddef9"><meta property="dc:modified" content="2022-04-07T10:40:17.000Z"><meta property="mw:htmlVersion" content="2.4.0"><meta property="mw:html:version" content="2.4.0"><link rel="dc:isVersionOf" href="//cs.wikipedia.org/wiki/Wikipedie%3AP%C3%ADskovi%C5%A1t%C4%9B"><base href="https://cs.wikipedia.org/wiki/"><title>Wikipedie:Pískoviště</title><link rel="stylesheet" href="/w/load.php?lang=cs&amp;modules=mediawiki.skinning.content.parsoid%7Cmediawiki.skinning.interface%7Csite.styles&amp;only=styles&amp;skin=vector"><meta http-equiv="content-language" content="cs"><meta http-equiv="vary" content="Accept"></head><body id="mwAA" lang="cs" class="mw-content-ltr sitedir-ltr ltr mw-body-content parsoid-body mediawiki mw-parser-output" dir="ltr"><table typeof="mw:Transclusion" data-mw="{&quot;parts&quot;:[{&quot;template&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;Infobox - ostrov\n  &quot;,&quot;href&quot;:&quot;./Šablona:Infobox_-_ostrov&quot;},&quot;params&quot;:{&quot;název&quot;:{&quot;wt&quot;:&quot;Katina&quot;},&quot;název místním jazykem&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;místní jazyk&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;obrázek&quot;:{&quot;wt&quot;:&quot;Katina.jpg&quot;},&quot;popisek&quot;:{&quot;wt&quot;:&quot;Pobřeží Katiny&quot;},&quot;mapa&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;popisek mapy&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;loc-map&quot;:{&quot;wt&quot;:&quot;{{LocMap\n |Chorvatsko\n |label= Katina\n |lat_deg=43.882914\n |lat_min=0\n |lon_deg=15.220390\n |lon_min=0\n |lat_dir=N\n |lon_dir=E\n |position=left\n |float=center\n |mark=Yellow pog.svg\n |relief=yes\n |caption=\n}}&quot;},&quot;lokalizace&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;ostrovní oblast&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;stát&quot;:{&quot;wt&quot;:&quot;Chorvatsko&quot;},&quot;stát2&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;stát3&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;název části1&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;část1&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;název části2&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;část2&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;název části3&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;část3&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;název části4&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;část4&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;název části5&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;část5&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;název části6&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;část6&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;rozloha&quot;:{&quot;wt&quot;:&quot;1,13&quot;},&quot;zeměpisná šířka&quot;:{&quot;wt&quot;:&quot;43.882914&quot;},&quot;zeměpisná délka&quot;:{&quot;wt&quot;:&quot;15.220390&quot;},&quot;délka&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;šířka&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;pobřeží&quot;:{&quot;wt&quot;:&quot;7,107&quot;},&quot;nejvyšší vrchol&quot;:{&quot;wt&quot;:&quot;[[Velki vrh]]&quot;},&quot;výška vrcholu&quot;:{&quot;wt&quot;:&quot;117&quot;},&quot;počet obyvatel&quot;:{&quot;wt&quot;:&quot;0&quot;},&quot;obyvatelé aktuální k&quot;:{&quot;wt&quot;:&quot;2011&quot;},&quot;hustota zalidnění&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;používané jazyky&quot;:{&quot;wt&quot;:&quot;&quot;},&quot;největší sídlo&quot;:{&quot;wt&quot;:&quot;&quot;}},&quot;i&quot;:0}}]}"></table></body></html>

(this is a mess, but you can see that e.g. the numbered "název části" and "část" parameters are in order)

I wonder if it's a Parsoid issue? I'm not sure what the expected behavior actually is. Also, the template has TemplateData documentation, but it doesn't specify "paramOrder" (https://cs.wikipedia.org/wiki/Šablona:Infobox_-_ostrov) – I don't know what are the expected consequences of that.

Change 786431 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Fix using sort order from data-mw when serializing template params

https://gerrit.wikimedia.org/r/786431

Arlolra triaged this task as Medium priority.
Arlolra moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.

Change 786431 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Fix using sort order from data-mw when serializing template params

https://gerrit.wikimedia.org/r/786431

Change 792236 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/vendor@master] Bump parsoid to 0.16.0-a8

https://gerrit.wikimedia.org/r/792236

Change 792236 merged by jenkins-bot:

[mediawiki/vendor@master] Bump parsoid to 0.16.0-a8

https://gerrit.wikimedia.org/r/792236