Review main Abandoned

94886[BUGFIX] Keep all link parts when updating a link in the link browser

Benni Mack CR 0 V -1 Easy +3 −5 updated 07/24/26, 10:48

Commit message

The "Update" button of the link browser finalizes the link stored in
the data-linkbrowser-current-link body attribute. PageLinkHandler
rebuilt this value from only the page ID and the fragment, silently
discarding the page type and any additional parameters (e.g. "&L=1"
or values from the "Additional link parameters" field).

Serialize the fully parsed link instead, as RecordLinkHandler
already does.

Review

  • Code review CR 0
  • Verified V -1
    • Benjamin Franzke -1
    • core-ci +1 CI

Issues 1

Files 1

Review log 56

  1. Benni Mack uploaded patch set 1 07/22/26, 15:21

  2. core-ci voted on patch set 1 V +1 07/22/26, 15:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105189

  3. Benjamin Franzke commented on patch set 1 V -1 07/23/26, 06:55

    Hm, opening the link browser on a link as mentioned in the ticket (`t3://page?uid=6&L=1#123`) results in a `TYPO3\CMS\Core\LinkHandling\Exception\UnknownLinkHandlerException, code #1460629247, file typo3/sysext/core/Classes/LinkHandling/LinkService.php, line 197: No valid handlers found for type` exception for me, because `LinkService::asString` refuses to create a string, if there is no type given `$this->linkParts` contains a type, but `linkParts['url']` (which is passed on) does not, which is why `LinkService::asString()` refuses.. ``` url => array(3 items) pageuid => 6 (integer) parameters => 'L=1' (3 chars) fragment => '123' (3 chars) target => '' (0 chars) class => '' (0 chars) title => '' (0 chars) params => '' (0 chars) type => 'page' (4 chars) ``` The difference to `RecordLinkHandler` is, that that one actually copies the type into the `url` subarray in `RecordLinkHandler::canHandleLink()`: https://github.com/TYPO3/typo3/blob/89d7ee93b2d49c12179b03704e188bc5561964f9/typo3/sysext/backend/Classes/LinkHandler/RecordLinkHandler.php#L126 Can you please recheck why this fix worked for you at all?
  4. Benni Mack commented on patch set 1 07/24/26, 07:16

    Reply

    yeah, I've been fixing an issue in my extension link2language in this case... will try without it again.
  5. Benni Mack commented on patch set 1 07/24/26, 10:48

    Reply

    This is my fix in link2language... https://github.com/b13/link2language/commit/d75d45c054b83bdcea552383ee5384c051833f0e since we do not use the &L=1 in this way in core but with the 6th parameter in the typolink service, core is not broken, and can be left as is... and: you're right, the fix is no fix, but actually breaks stuff.
  6. Benni Mack abandoned the change 07/24/26, 10:48

    not needed