Page MenuHomePhabricator

VisualEditor generate wrong label for specific it.wiki template
Closed, ResolvedPublicBUG REPORT

Description

What happens?:
The generated label is:

Generato da: [[...|:...]]

What should have happened instead?:
The generated label should be:

Generato da: [[template:...|...]]

or maybe

Generato da: [[template:sezione vuota|...]]

Other information

Event Timeline

• matmarex subscribed.

Parsoid generates incorrect data – for example, on https://it.wikipedia.org/w/index.php?title=Anni_1760&useparsoid=1:

data-mw='{"parts":[{"template":{"target":{"wt":"...","href":"./..."},"params":{"1":{"wt":"cronologia"}},"i":0}}]}'

In href, there should be a Template: prefix. Compare to other templates used on the same page:

data-mw='{"parts":[{"template":{"target":{"wt":"Decennio","href":"./Template:Decennio"},"params":{"1":{"wt":"176"}},"i":0}}]}'
data-mw='{"parts":[{"template":{"target":{"wt":"interprogetto","href":"./Template:Interprogetto"},"params":{},"i":0}},"\n\n[[Categoria:Decenni del XVIII secolo| 07]]"]}'

This happens to any template that starts with a full stop:

  • {{foo}} -> "./Template:Foo"
  • {{.foo}} -> "./.foo"

This is an issue with $env->makeLink(..) which has this code:

	public function makeLink( Title $title ): string {
		// T380676: This method *should* be used only for local titles,
		// (ie $title->getInterwiki() should be '') but apparently we
		// are using it for interwiki/interlanguage links as well.
		return $this->getSiteConfig()->relativeLinkPrefix() . Sanitizer::sanitizeTitleURI(
			$title->getFullDBKey(),
			false
		);
	}

To be continued ...

Change #1311935 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/services/parsoid@master] WIP: Fix bug setting namespace in TemplateHandler

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

Change #1311935 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Fix bug setting namespace in TemplateHandler

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

Change #1318304 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.24.0-a17

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

Change #1318304 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.24.0-a17

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

Change #1318746 had a related patch set uploaded (by Arlolra; author: Subramanya Sastry):

[mediawiki/vendor@wmf/1.47.0-wmf.13] Bump wikimedia/parsoid to 0.24.0-a17

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

Change #1318746 merged by jenkins-bot:

[mediawiki/vendor@wmf/1.47.0-wmf.13] Bump wikimedia/parsoid to 0.24.0-a17

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

Mentioned in SAL (#wikimedia-operations) [2026-07-28T20:50:11Z] <arlolra@deploy1003> Started scap sync-world: Backport for [[gerrit:1318746|Bump wikimedia/parsoid to 0.24.0-a17 (T19006 T234299 T360814 T385317 T432477 T433018)]], [[gerrit:1318747|Bump wikimedia/parsoid to 0.24.0-a17 (T433018)]]

Mentioned in SAL (#wikimedia-operations) [2026-07-28T20:58:30Z] <arlolra@deploy1003> Finished scap sync-world: Backport for [[gerrit:1318746|Bump wikimedia/parsoid to 0.24.0-a17 (T19006 T234299 T360814 T385317 T432477 T433018)]], [[gerrit:1318747|Bump wikimedia/parsoid to 0.24.0-a17 (T433018)]] (duration: 08m 19s)