Bug #67669

noTrimWrap not working with optionSplit

Added by Stefan Neufeind over 4 years ago. Updated about 2 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2015-06-22
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I've used noTrimWrap in a TMENU together with optionSplit. It worked fine in TYPO3 4.5 but failed after upgrading to 6.2. It turns out to be caused by #20793, which itself aims to be a bugfix. Regression here?


Related issues

Related to TYPO3 Core - Bug #20793: noTrimWrap = | || won't work inside a menu Closed 2009-07-29

History

#1 Updated by Jigal van Hemert over 4 years ago

  • Status changed from New to Needs Feedback

Can you provide some sample code that shows what you expect to work?

#2 Updated by Stefan Neufeind over 4 years ago

Code that worked fine with a TMENU-rootline-menu on 4.5 is:

stdWrap.noTrimWrap = | |*| | > |

Since it didn't work on 6.2 anymore for the moment I've switched to just "wrap" with optionsplit. As is obvious the spaces needed to become   or so then, but it worked fine with wrap instead of noTrimWrap. And it turns out the patch I mentioned caused/causes the problem.

#3 Updated by Alexander Opitz over 4 years ago

  • Status changed from Needs Feedback to New

#4 Updated by Jigal van Hemert over 4 years ago

Stefan Neufeind wrote:

Code that worked fine with a TMENU-rootline-menu on 4.5 is:

stdWrap.noTrimWrap = | |*| | > |

Since it didn't work on 6.2 anymore for the moment I've switched to just "wrap" with optionsplit. As is obvious the spaces needed to become   or so then, but it worked fine with wrap instead of noTrimWrap. And it turns out the patch I mentioned caused/causes the problem.

OptionSplit takes precedence, so the |*| will turn this into:
first = |
middle = | > |

I'm not surprised that both values will not do what you expect.

In 6.1 and higher you can define a different split character for noTrimWrap and let optionSplit use the usual || and |*| combinations.
Since you mention a rootline menu I guess you want to prefix the second and following items with a '>'.

noTrimWrap = ^^^ |*| ^ > ^^
noTrimWrap.splitChar = ^

This would use the '^' as the split character for the noTrimWrap, while optionSplit uses the |*|

This is documented in the TSreference:
https://docs.typo3.org/typo3cms/TyposcriptReference/Functions/Stdwrap/Index.html#notrimwrap

#5 Updated by Riccardo De Contardi about 3 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Stefan Neufeind

Hi Stefan,
the behavior reported by Jigal is indeed documented since 6.2; do you think it is sufficient to close this issue? Could you test it? Thank you!

#6 Updated by Alexander Opitz almost 3 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee deleted (Stefan Neufeind)

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

#7 Updated by DANIEL Rémy 2 months ago

TYPO3 9.5

I am trying to use noTrimWrap with option split, without success.

You can reproduce it with that piece of TypoScript.
You should have a page tree with at least 3 levels, and viewing a page on the 3rd level.

page = PAGE
page.config.admPanel = 0
page.config.disableAllHeaderCode = 1
page.10 = HMENU
page.10 {
    special = rootline
    special.range = 0|-1
    1 = TMENU
    1.NO {
        allStdWrap.noTrimWrap = ^^^ |*| ^ > ^^
        allStdWrap.noTrimWrap.splitChar = ^
    }
}

The expected output should be:

<a href="/">Rootpage</a> &gt; <a href="/level-1">Level 1</a> &gt; <a href="/level-1/level-2">Level 2</a> &gt; <a href="/level-1/level-2/level-3">Level 3</a>

Instead, I see:

<a href="/">Rootpage</a><a href="/level-1">Level 1</a><a href="/level-1/level-2">Level 2</a><a href="/level-1/level-2/level-3">Level 3</a>

It seems that noTrimWrap does not take optionsplit into account at all, and parses only the first part of the string matching the 3 first splitChar only.
The rest of the string is discarded.

I tested with wrap + splitChar, and the optionsplit works well.

#8 Updated by Riccardo De Contardi 2 months ago

  • Status changed from Closed to New

#9 Updated by Jigal van Hemert about 2 months ago

Confirmed. https://review.typo3.org/c/Packages/TYPO3.CMS/+/7255/ causes noTrimWrap to not support optionSplit any more. The original patch for #20793 solved conflicts between optionSplit (which assumes that "||" is part of optionSplit) and noTrimWrap by allowing a different splitChar for the latter.
The solution for the problem that noTrimWrap = | || doesn't work should've been to use a different splitChar for noTrimWrap.

The best way would be to revert https://review.typo3.org/c/Packages/TYPO3.CMS/+/7255/ but that would be a breaking change. I don't see a solution to support both things like noTrimWrap = | || and optionSplit at the same time.

Also available in: Atom PDF