Bug #88123

menuConfig of LanguageMenuProcessor should be merged with processor configuration in TypoScript

Added by Bjoern Jacob about 2 months ago. Updated 18 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2019-04-09
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Associated revisions

Revision d85876bc (diff)
Added by Daniel Lorenz about 2 months ago

[BUGFIX] Fix handling menuConfig of LanguageMenuProcessor

Use array_merge instead of union (+=) in order to
correctly handle overriding the menu configuration
of the LanguageMenuProcessor.

Resolves: #88123
Releases: master, 9.5
Change-Id: I1f382c11b2f24c052b97af2b7d62a6e0712e10e9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60432
Tested-by: Björn Jacob <>
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Tested-by: Richard Haeser <>
Reviewed-by: Björn Jacob <>
Reviewed-by: Richard Haeser <>

Revision 5662356e (diff)
Added by Daniel Lorenz about 2 months ago

[BUGFIX] Fix handling menuConfig of LanguageMenuProcessor

Use array_merge instead of union (+=) in order to
correctly handle overriding the menu configuration
of the LanguageMenuProcessor.

Resolves: #88123
Releases: master, 9.5
Change-Id: I1f382c11b2f24c052b97af2b7d62a6e0712e10e9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60434
Tested-by: TYPO3com <>
Tested-by: Richard Haeser <>
Reviewed-by: Richard Haeser <>

History

#1 Updated by Gerrit Code Review about 2 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60432

#2 Updated by Gerrit Code Review about 2 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60434

#3 Updated by Daniel Lorenz about 2 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Benni Mack 18 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF