Project

General

Profile

Actions

Bug #98601

open

typolink with parameter "/"

Added by Peter Linzenkirchner over 1 year ago. Updated 5 months ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-10-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

the following viewhelper:

<f:link.typolink parameter="/" ></f:link.typolink>

results in an empty link <a class="">

This affects especially the language menus because the language data handler delivers "link: /" for the homepage in the default language.

In constructions like

<f:link.typolink parameter="{languagemenu.link}" ></f:link.typolink>

this results in empty links for the homepage in the default language.

Reason is a modification in typo3/systext/frontend/Classes/Service/TypoLinkCodecService.php. This line from Typo3 vs. 10:

$value = str_replace(['\\', '"'], ['\\\\', '\\"'], $value);

changes to:

$parts = str_replace(['\\\\', '\\"'], ['\\', '"'], str_getcsv($typoLink, static::$partDelimiter));

str_getcsv removes single slashes.

Actions #1

Updated by Chris Müller over 1 year ago

To circumvent this you can use just a plain "a" tag as the menu link has not to be processed via a view helper.

Actions #2

Updated by Benni Mack 10 months ago

  • Status changed from New to Needs Feedback

Chris Müller wrote in #note-1:

To circumvent this you can use just a plain "a" tag as the menu link has not to be processed via a view helper.

I agree, I would do 100% the same: Using a menu "link" attribute again in a typolink will also double your DB requests for fetching the page again.

Maybe we need to update the docs for the menu processor / language menu processor that people should use <a> tags then.,

Actions #3

Updated by Philipp Kitzberger 7 months ago

Maybe the f:link.typolink should even throw a warning (deprecation log?) when parameter is starting with a slash?

"Don't put rendered pre-rendered stuff where it doesn't belong" ;-)

Actions #4

Updated by Benni Mack 5 months ago

Philipp Kitzberger wrote in #note-3:

Maybe the f:link.typolink should even throw a warning (deprecation log?) when parameter is starting with a slash?

People actually use it like this as well "/fileadmin/myfile.zip", how should we handle this then?

Actions

Also available in: Atom PDF