Page MenuHomePhabricator

generateSitemap.php: Variant links in the generated sitemap are broken
Open, Needs TriagePublicBUG REPORT

Description

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

  • Install mediawiki in language with variants.
  • Create some pages in the main namespace.
  • Run the generateSitemap.php script to generate a sitemap.

What happens?:

The URLs generated are not valid variant links.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<url>
		<loc>https://example.wiki/Title</loc>
		<lastmod>2023-08-28T17:30:36Z</lastmod>
		<priority>1.0</priority>
	</url>
	<url>
		<loc>https://example.wiki/index.php?title=Title&amp;zh-hans</loc>
		<lastmod>2023-08-28T17:30:36Z</lastmod>
		<priority>1.0</priority>
	</url>
	<url>
		<loc>https://example.wiki/index.php?title=Title&amp;zh-hant</loc>
		<lastmod>2023-08-28T17:30:36Z</lastmod>
		<priority>1.0</priority>
	</url>
	<url>
		<loc>https://example.wiki/index.php?title=Title&amp;zh-cn</loc>
		<lastmod>2023-08-28T17:30:36Z</lastmod>
		<priority>1.0</priority>
	</url>

What should have happened instead?:

The URLs generated should be valid variant links, and follow the $wgVariantArticlePath config.

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

master branch

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

Caused by commit 3454a597f7f1aa6040f39ceb359ef6b7acafee39

Event Timeline

Change 960674 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] generateSitemap: Fix the variant query param

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

Change 960674 merged by jenkins-bot:

[mediawiki/core@master] generateSitemap: Fix the variant query param

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