Review 11.5 Abandoned

80988[BUGFIX] Use link text with typolink userfunc

Mike Street CR 0 V 0 Easy +1 −1 updated 10/31/24, 14:42

Commit message

Ensure the typolink generated with userfunc uses the existing link text

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 34

  1. Mike Street uploaded patch set 1 09/13/23, 08:27

  2. core-ci voted on patch set 1 V +1 09/13/23, 08:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46533

  3. Garvin Hicking commented on patch set 1 09/14/23, 13:46

    Unresolved

    Thanks for contributing this patch! I tried to verify it, but couldn't really reproduce your initial issue (in a 11.5 instance of course). I tried with a simple typoscript like this (also omitting `returnLast` and just getting the link): ``` headerData.17 = TEXT headerData.17.value = Link to the page with the ID 86 in the current language headerData.17.typolink.parameter = 85 headerData.17.typolink.userFunc = Faktore\FeKuerschnerSite\Xclass\Typolink->formatlink headerData.17.typolink.returnLast = result ``` and that custom userfunc: ``` <?php namespace Faktore\FeKuerschnerSite\Xclass; class Typolink { function formatlink($content) { return '<a href="#" data-something="anything" data-title="bloblo">'; } } ``` That resolves (without your patch) to: ``` {"href":"#","target":null,"class":null,"title":null,"linkText":"Link to the page with the ID 86 in the current language","additionalAttributes":{"data-something":"anything","data-title":"bloblo"}} ``` so `linktext` remains set to the initial Linktext here. So I wonder what your userFunc does and what maybe gets passed in here, just so we can make sure (ideally via tests) it all works in v12 and v13 properly as well, since there the API has changed a bit. :-)
  4. Benni Mack abandoned the change 10/31/24, 14:42

    abandoned for v11.5 - see issue which is now closed