Issue Bug Closed

#105840TYPO3_CONF_VARS additionalCanonicalizedUrlParameters not functional

Alexander Köberl 12/17/24, 16:45 updated 12/18/24, 09:10

Description

$GLOBALS[‘TYPO3_CONF_VARS’][‘FE’][‘additionalCanonicalizedUrlParameters’][] as described in https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/Seo/CanonicalApi.html is not functional.
My argument “?tx_fmdreferences_reference%5Bcategory%5D=5” written as ‘tx_fmdreferences_reference[category]’ in this configuration is ignored and still used in the canonical tag.

I had a look at TYPO3\CMS\Frontend\Utility\CanonicalizationUtility and in my opinion the line

return array_diff($paramsToExclude, $additionalCanonicalizedUrlParameters);
does remove the parameters from $additionalCanonicalizedUrlParameters.
I changed the code to

return array_unique(array_merge($paramsToExclude, $additionalCanonicalizedUrlParameters));
what now seems to work. As I have seen the method in TYPO3 v12 is still the same, so its the same fault.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.