Project

General

Profile

Actions

Bug #105266

open

Sitemap Cache Bug on missing chash

Added by Andreas Gröf about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2024-10-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When Caching the Sitemap, get-Params seem to be ignored if no cHash is given. Which can result in a wrong Sitemap rendered.

1. Clear the Cache
2. Call a Subpage of your Sitemap without chash e.g. /sitemap.xml?sitemap=pages or ?type=1533906435&sitemap=pages (without RouteEnhancer)
3. Call the Sitemaps Index Page (/sitemap.xml or ?type=1533906435)

-> The Subpage will be shown instead of the Index-Page

Only tested in TYPO3 12

Actions #1

Updated by Moritz Ngo about 1 month ago

I could confirm this behavior in several different TYPO3 CMS installations.

I'm not sure if this issue is related to EXT:seo's XML sitemap or even larger to the general page rendering. I haven't enough time to investigate any further but to reproduce this behavior.

Actions #2

Updated by Garvin Hicking about 1 month ago

  • Category set to Site Handling, Site Sets & Routing

(Setting a category; unsure if it's right, but maybe Routijg fits better than ext:seo?)

Actions #3

Updated by Andreas Gröf about 1 month ago

Now I had a bit of time investigating.
The Problem is, that queryParams are ignored in Caching, when no cHash is given.
But im not sure what should be the correct behavior.

vendor/typo3/cms-frontend/Classes/Controller/TypoScriptFrontendController.php Line 1130

 protected function getRelevantParametersForCachingFromPageArguments(PageArguments $pageArguments): array
    {
        $queryParams = $pageArguments->getDynamicArguments();
        if (!empty($queryParams) && ($pageArguments->getArguments()['cHash'] ?? false)) {
            $queryParams['id'] = $pageArguments->getPageId();
            return GeneralUtility::makeInstance(CacheHashCalculator::class)
                ->getRelevantParameters(HttpUtility::buildQueryString($queryParams));
        }
        return [];
    }

Actions

Also available in: Atom PDF