Bug #81620

Linkhandler remove all attributes set in the link wizard and the template

Added by Kevin Appelt 4 months ago. Updated about 2 months ago.

Status:
Under Review
Priority:
Must have
Assignee:
-
Category:
Link Handling
Start date:
2017-06-19
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.0
Tags:
linkhandler, typolink
Complexity:
medium
Is Regression:
Sprint Focus:

Description

My configuration

I am using version TYPO3 CMS 8.7.1 and the linkhandler from core.

I have a template like this:

<f:link.typolink parameter="{link}" class="btn more">Mehr erfahren</f:link.typolink>

I have the following pageTsConfig:

TCEMAIN {
    linkHandler {
        tx_news {
            handler = TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler
            label = News
            configuration {
                table = tx_news_domain_model_news
                hidePageTree = 0
            }
            scanAfter = page
        }
    }
}

And this typoscript:

config {
    recordLinks {
        tx_news {
            typolink {
                parameter = {$id.newsDetailPid}
                additionalParams.data = field:uid
                additionalParams.wrap = &tx_news_pi1[news]=|&tx_news_pi1[action]=detail&tx_news_pi1[controller]=news
                useCacheHash = 1
            }
        }
    }
}

{$id.newsDetailPid} is set as 22.

The scenario

Now i create a link with the link wizard to a page (uid: 30) with some extra attributes set

t3://page?uid=30 _blank "btn special" Testtitle google=bad

and get this:
<a href="/index.php?id=1&google=bad" title="Testtitle" target="_blank" class="btn special more">Mehr erfahren</a>

Now i create a link with the link wizard to a news record (uid:1) with the same extra attributes set
t3://record?identifier=tx_news&uid=1 _blank "btn special" Testtitle google=bad

and get this:
<a href="/index.php?id=22&tx_news_pi1%5Bnews%5D=1&amp;tx_news_pi1%5Baction%5D=detail&amp;tx_news_pi1%5Bcontroller%5D=news&amp;cHash=e68aca14db3f2e4bc194845e951acc11">Mehr erfahren</a>

The problem

If i use a link created with linkhandler all attributes get completly removed.
I think the problem is somewhere in the method typoLink in /typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php but i am not sure.

One way it works to add the classes - but it is not useful

To add the classes i have to set them in the `parameter` in the typoscript of the linkhandler.
But this is not what is needed, because there is no class for “link to news” but the tags may have classes like in the example.

History

#1 Updated by Gerrit Code Review 4 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/53275

#2 Updated by Gerrit Code Review 4 months 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/53275

#3 Updated by Gerrit Code Review 4 months ago

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

#4 Updated by Gerrit Code Review 3 months ago

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

#5 Updated by Markus Klein 3 months ago

  • Complexity set to medium
  • Sprint Focus set to On Location Sprint

#6 Updated by Mathias Brodala 3 months ago

  • Duplicated by Bug #81903: DatabaseRecordLinkBuilder is ignoring other settings added

#7 Updated by Mathias Brodala 3 months ago

  • Duplicated by deleted (Bug #81903: DatabaseRecordLinkBuilder is ignoring other settings)

#8 Updated by Dennis Römmich 3 months ago

What should be the expected behavior if i have the following link within the RTE:

<a class="btn special" title="Testtitle" href="t3://record?identifier=tx_news&uid=1">convallis</a>

I think this behavior is not covered by the given patch in gerrit, isn't it?

#9 Updated by Anja Leichsenring about 2 months ago

  • Sprint Focus deleted (On Location Sprint)

Also available in: Atom PDF