Page MenuHomePhabricator

Linter detected valid file option "sub" as a bogus file option
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • Three times a wrong "sub" file parameter is shown.

What should have happened instead?:

  • Nothing should be shown because "sub" is a valid image parameter.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • In Rail-interchange template there are three lines for Hungary producing this lint error:
| hu | hungary ={{#switch:  {{lc: {{{2}}} }}
  | rail =[[File:BSicon MAV.svg|{{{size|20}}}px|link=|alt=railway|railway]]
  | tram =[[File:KRESZ villamos.svg|{{{size|34}}}px|sub|link=|alt=tram|tram]]
  | trolleybus =[[File:KRESZ troli.svg|{{{size|25}}}px|sub|link=|alt=trolleybus|trolleybus]]
  | bus =[[File:KRESZ busz.svg|{{{size|24}}}px|sub|link=|alt=bus|bus]]
  }}

Event Timeline

Reedy renamed this task from Linter detectd valid file option "sub" as a bogus file option to Linter detectdd valid file option "sub" as a bogus file option.Aug 26 2023, 6:08 PM
Reedy renamed this task from Linter detectdd valid file option "sub" as a bogus file option to Linter detected valid file option "sub" as a bogus file option.
Arlolra triaged this task as Medium priority.Aug 28 2023, 5:03 PM
Arlolra moved this task from Backlog to Parsoid on the MediaWiki-extensions-Linter board.
Arlolra added a project: Parsoid.
Arlolra subscribed.

Taking a look at https://de.wikivoyage.org/w/api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics|magicwords

"magicwords": [
         ...
         {
             "name": "img_sub",
             "aliases": [
                 "tief",
                 "tiefgestellt",
                 "sub"
             ],
             "case-sensitive": ""
         },
         ...
         {
             "name": "sub",
             "aliases": [
                 "sub"
             ]
         },
          ...
],

So, some internal data structure in Parsoid is getting confused by having two magic words with the same alias.

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

[mediawiki/services/parsoid@master] [WIP] Magic words aliases aren't necessarily unique to a magic word

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

Change 952947 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Magic words aliases aren't necessarily unique to a magic word

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

Change 962706 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.18.0-a26

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

Change 962706 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.18.0-a26

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