Actions
Bug #84287
closedlinkhandler config.recordLinks.tx_news.parameter = 1 fails
Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2018-03-15
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
scenario
I have a link to an detail page (for simplicity let's say a news). I create a Typolink using Typoscript.
lib.link = TEXT
lib.link.typolink.parameter = t3://record?identifier=tx_news&uid=5
Now the config.recordLinks looks like this
config.recordLinks.tx_next { typolink.parameter = 1 }
Expected behaviour
lib.link should create a link to page did 1¶
Actual behaviour
PHP Warning: trim() expects parameter 1 to be string, array given in /var/www/html/vendor/typo3/cms/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 5667¶
What happened?
\TYPO3\CMS\Frontend\Typolink\DatabaseRecordLinkBuilder::build uses array_merge_recursive to combine both typolinks. A quick test:
php -r "var_dump(array_merge_recursive(['parameter' => 'link1'], ['parameter' => 'link2']));"
array(1) {
'parameter' =>
array(2) {
[0] =>
string(5) "link1"
[1] =>
string(5) "link2"
}
}
So typolink.parameter becomes an array which breaks the typolink method.
Updated by Marco Pfeiffer over 6 years ago
The quick workaround is defining recordLinks like this:
config.recordLinks.tx_next { typolink.parameter.cObject = TEXT typolink.parameter.cObject.value = 1 }
This will prevent parameter from becoming an array and still result in parameter "1" when stdWrap is evaluated.
Updated by Susanne Moog over 4 years ago
- Is duplicate of Bug #84116: Linkhandler links not rendered in frontend when TSConfig configuration is applied using "registerPageTSConfigFile()" or "addPageTSConfig()" added
Updated by Susanne Moog over 4 years ago
- Status changed from New to Closed
This has been fixed with #84116
Actions