Project

General

Profile

Actions

Bug #84287

closed

linkhandler config.recordLinks.tx_news.parameter = 1 fails

Added by Marco Pfeiffer over 6 years ago. Updated over 4 years ago.

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.


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #84116: Linkhandler links not rendered in frontend when TSConfig configuration is applied using "registerPageTSConfigFile()" or "addPageTSConfig()"Closed2018-03-02

Actions
Actions #1

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.

Actions #2

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
Actions #3

Updated by Susanne Moog over 4 years ago

  • Status changed from New to Closed

This has been fixed with #84116

Actions

Also available in: Atom PDF