Project

General

Profile

Actions

Bug #53214

closed

TypoScript noTrimWrap Bug in FILES

Added by Gernot Ploiner over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2013-10-30
Due date:
% Done:

0%

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

Description

If you want to use noTrimWrap somewhere inside of a FILES cObject, it wont work correct.
The first item (file) is trimmed at the end (but shouldn't).
From the second item to the last the noTrimWrap is missing at all (spaces and letters).
Btw: It doesn't matter if you use a static file (like in my example) or file.import...

To reproduce the following code, prepare some jpg-file in this folder: /fileadmin/gallery/
One Picture should have the name A_Desert.jpg (you can also adjust the filename in typoscript above).

------------------------------
Test 1) Regular working example
Output: aaa - bbb

page = PAGE
page {
  10 = TEXT
  10.*value = aaa*

  20 = TEXT
  20.*value = bbb*
  20.*noTrimWrap = | - ||*
}

------------------------------
Test 2) Bug with noTrimWrap
Output first Image (space missing): aaa -bbb
Output of following Images (complete noTrimWrap missing): aaabbb

page = PAGE
page {
  20 = FILES
  20 {
    folders = 1:gallery/
    renderObj = COA
    renderObj {
      10 = TEXT
      10.*value = aaa*

      20 = TEXT
      20.*value = bbb*
      20.*noTrimWrap = | - ||*
    }
  }
}

------------------------------
Test 3) The Position of the noTrimWrap doesn't matter. The Problem appears always. Here is an other Example.
Output first Image: <a href="index.php?id=1" title="*aaa x-ybbb*"><img src="fileadmin/gallery/A_Desert.jpg" width="1024" height="768" border="0" alt=""></a>
Output of following Images: <a href="index.php?id=1" title="*aaabbb*"><img src="fileadmin/gallery/A_Desert.jpg" width="1024" height="768" border="0" alt=""></a>

page = PAGE
page {
  20 = FILES
  20 {
    folders = 1:gallery/
    renderObj = COA
    renderObj {
      10 = IMAGE
      10 {
        file = fileadmin/gallery/A_Desert.jpg
        stdWrap.typolink.parameter = 1
        stdWrap.typolink.ATagParams.cObject = COA
        stdWrap.typolink.ATagParams.cObject {
          30 = COA
          30 {
            stdWrap.noTrimWrap= | title="|" |

            10 = TEXT
            10.*value = aaa*

            20 = TEXT
            20.*value = bbb*
            20.*noTrimWrap = | x-y ||*
          }  
        }
      }
    }
  }
}

Files

typoscript.txt (1.54 KB) typoscript.txt TypoScript for better copy & paste ;-) Gernot Ploiner, 2013-10-30 07:41
Actions #1

Updated by Gernot Ploiner over 10 years ago

Added TypoScript as attachement.

Actions #2

Updated by Stefan Froemken over 10 years ago

I can reproduce this problem. But it is not a problem of renderObj. It's more a problem of splitConfArray. It can work with optionSplit and searches for || and |*|. In your example you have such a part in noTrimWrap. That's why this information gets lost.

Actions #3

Updated by Gernot Ploiner over 10 years ago

Its not a Bug, its a Feature ;-)

The solution is to use spaces everywhere:
noTrimWrap = | - | |

and not:
noTrimWrap = | - ||

A hint in TSREF at renderObj would be great:
Be careful with noTrimWrap, because of the OptionSplit function. Never use || without spaces! OptionSplit comes first.

(My english is not the best, so feel free to modify my Text ;-)

Thank you and close this Ticket please.

Actions #4

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/25063

Actions #5

Updated by Stefan Froemken over 10 years ago

I have created a patch for it. This patch excludes noTrimWrap from optionSplit. The other option is to remove optionSlit from FILES-cObject. Your solution append an additional Space behind. In HTML this is visible as one space, but in Sourcecode you have two spaces.

Actions #6

Updated by Stefan Froemken over 10 years ago

Dmitry meens it's better to work with splitChar:

page.1 = FILES
page.1 {
  folders = 1:user_upload/images/examples/
  sorting = date
  sorting.direction = ASC
  renderObj = COA
  renderObj {
    10 = TEXT
    10.value = aaa
    20 = TEXT
    20.value = bbb
    20.noTrimWrap = $ - $$
    20.noTrimWrap.splitChar = $
  }
}

In my opinion this needs to be extra documented.

Stefan

Actions #7

Updated by Stefan Froemken over 10 years ago

I have created a new issue for Documentation-Team and set it as relation. So this is a "solved-by-docu"-issue.

You can close this ticket now.

Stefan

Actions #8

Updated by Gernot Ploiner over 10 years ago

The same Problem appears on the stdWrap function .split in combination with .cObjectNum or CONTENT/RECORDS and so on. Perhaps in some other constellations too?
So it is a general TypoScript Problem. It doesn't depend on the new FILES cObject.
The splitChar Solution is great. But you are right: Its hard to find out. But where should it be documented because it doensn't depend on FILES?

Actions #10

Updated by Gernot Ploiner over 10 years ago

thank you, good work.
you can close this ticket.

Actions #11

Updated by Chris topher over 10 years ago

  • Status changed from Under Review to Closed
  • Target version deleted (next-patchlevel)

Closed as requested.

Actions

Also available in: Atom PDF