Bug #88123
closedmenuConfig of LanguageMenuProcessor should be merged with processor configuration in TypoScript
100%
Description
Use case¶
Imagine the following use case. We are having a page with a plugin listing news entries. The limit per page is 10. A pagination is available. The amount of news entries differs between the languages. In the default language, there are 38 entries and therefore 4 pages in the pagination. The translated version only contains 27 entries. Thus, there are 3 pages in the pagination. If a user is on page 4 and switches to the translated version, an error 404 occurs. In order to avoid this, a solution could be to exclude the pagination parameter in the url of the LanguageMenuProcessor.
TypoScript example¶
20 = TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor 20 { languages = auto as = languageNavigation addQueryString.exclude = tx_news_pi1[@widget_0][currentPage] }
Current behaviour¶
The excluded URL parameter (tx_news_pi1[@widget_0][currentPage]
) is not available within the menuConfig array of the LanguageMenuProcessor. Since the menuConfig already contains a addQueryString
property, the one set via TypoScript is ignored.
Expected behaviour¶
Setting the configuration via TypoScript is taken into account by the LanguageMenuProcessor. Codewise, this can be achieved by merging the array instead of creating a union.