SitemapPathProcessor::processInbound() should run after PathProcessorLanguage::processInbound()

Created on 17 January 2024, 11 months ago
Updated 19 July 2024, 5 months ago

Problem/Motivation

SitemapPathProcessor::processInbound() has the same priority as core'sPathProcessorLanguage::processInbound(). In our case, simple sitemap's process runs before core's language inbound processor, which causes the language path element to still be present in the path when the code below runs.

public function processInbound($path, Request $request) {
$args = explode('/', $path ?? '');
if (count($args) === 3 && $args[2] === 'sitemap.xml') {
$path = '/sitemaps/' . $args[1] . '/sitemap.xml';
}

return $path;
}

Steps to reproduce

Since the priorities for both the language path processor and simple sitemap are both 300, I think the order in which they run is undetermined (so the problem might or might not occur?)

Proposed resolution

Ensure that SitemapPathProcessor::processInbound() runs after PathProcessorLanguage::processInbound().

Remaining tasks

Review.

User interface changes

None

API changes

None

Data model changes

None.

🐛 Bug report
Status

Closed: works as designed

Version

4.1

Component

Code

Created by

🇧🇪Belgium mr.baileys 🇧🇪 (Ghent)

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024