Bug #84925

config.forceTypeValue does not work as PageLinkBuilder defaults to 0 if no pagetype parameter is set

Added by Andreas Allacher over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2018-05-04
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In PageLinkBuilder there is the following code:

$pageType = $linkDetails['pagetype'] ?? 0;

This $pageType parameter is then used as typeOverride for this link which has precedence over config.forceTypeValue
However, in case of it not being set config.forceTypeValue should be used.

I think the easiest solution would be to default to en empty string as that is the default value for linkData or in 9.x createTotalUrlAndLinkData also.

Associated revisions

Revision 1ab8bcf4 (diff)
Added by Andreas Allacher over 1 year ago

[BUGFIX] do not override forceTypeValue if no pageType is set

If a link doesn't set a pageType and
there is no target that defines a pageType,
then forceTypeValue needs to be used instead of always
assuming a pageType of 0.

With this fix, it is possible to actually use
the TypoScript option config.forceTypeValue again.

Resolves: #84925
Releases: master, 8.7
Change-Id: Iae6ba57e943489e4d6a6c690a7668d6908d1623e
Reviewed-on: https://review.typo3.org/56863
Reviewed-by: Benni Mack <>
Tested-by: TYPO3com <>
Reviewed-by: Andreas Fernandez <>
Reviewed-by: Tymoteusz Motylewski <>
Tested-by: Tymoteusz Motylewski <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

Revision 375cabb9 (diff)
Added by Andreas Allacher over 1 year ago

[BUGFIX] do not override forceTypeValue if no pageType is set

If a link doesn't set a pageType and
there is no target that defines a pageType,
then forceTypeValue needs to be used instead of always
assuming a pageType of 0.

With this fix, it is possible to actually use
the TypoScript option config.forceTypeValue again.

Resolves: #84925
Releases: master, 8.7
Change-Id: Iae6ba57e943489e4d6a6c690a7668d6908d1623e
Reviewed-on: https://review.typo3.org/56961
Tested-by: TYPO3com <>
Reviewed-by: Mathias Brodala <>
Tested-by: Mathias Brodala <>

History

#1 Updated by Gerrit Code Review over 1 year 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/56863

#2 Updated by Gerrit Code Review over 1 year ago

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

#3 Updated by Andreas Allacher over 1 year ago

Example:
The following TypoScript setup:

config.forceTypeValue = 10
page = PAGE
page.10 = TEXT
page.10.value = Click
page.10.typelink.parameter = 1

testTypeNum = PAGE
testTypeNum.typeNum = 10
testTypeNum.10 = TEXt
testTypeNum.10.value = SUCCESS

should result in the generated link pointing to:
/index.php?id=1&type=10

However, the current behvaviour completely ignores forceTypeValue and just points to /index.php?id=1

#4 Updated by Tymoteusz Motylewski over 1 year ago

thanks for the config, little typo
page.10.typelink.parameter = 1

should be
page.10.typolink.parameter = 1

#5 Updated by Anonymous over 1 year ago

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

#6 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56961

#7 Updated by Anonymous over 1 year ago

  • Status changed from Under Review to Resolved

#8 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF