Bug #9864

Different rendering in Fluid-Syntax

Added by Michael Feinbier over 2 years ago. Updated 5 months ago.

Status:Closed Start date:2010-09-21
Priority:Should have Due date:
Assignee:Bastian Waidelich % Done:

0%

Category:Fluid
Target version:-
Complexity:
Votes: 0

Description

Hey,

firstly sorry for the stupid subject. Secondly, I am not shure if this is a bug or a misunderstood feature.
Imagine the following TypoScript snippet

lib.ext.lightboxImage = TEXT
lib.ext.lightboxImage.current = 1

And this fluid template snippet:

{image.fullPath -> f:cObject(typoscriptObjectPath: 'lib.ext.lightboxImage')}
{f:cObject(typoscriptObjectPath: 'lib.ext.lightboxImage' data: '{image.fullPath}')}
<f:cObject typoscriptObjectPath="lib.ext.lightboxImage" data="{image.fullPath}" />
<f:cObject typoscriptObjectPath="lib.ext.lightboxImage">{image.fullPath}</f:cObject>

{image.fullPath} is a path to a file which contains an ampersand (&). Now, in my opinion the output of the four syntaxes above should be equal, but in fact the output looks like this:

fileadmin/content/fotogalerie/Bowers &amp; Wilkins/CM Serie/CM9/CM9_Theatre_Wenge.jpg
fileadmin/content/fotogalerie/Bowers &amp; Wilkins/CM Serie/CM9/CM9_Theatre_Wenge.jpg
fileadmin/content/fotogalerie/Bowers & Wilkins/CM Serie/CM9/CM9_Theatre_Wenge.jpg
fileadmin/content/fotogalerie/Bowers &amp; Wilkins/CM Serie/CM9/CM9_Theatre_Wenge.jpg

All ViewHelper put the value throug htmlspecialchars() except the third method with the data attribute inline. Is this the desired behaviour?
Because if you change your TS Object to something like:
lib.ext.lightboxImage = IMG_RESOURCE
lib.ext.lightboxImage {
    file.import.current = 1
    file.maxW = 500
    file.maxH = 500
}

only the third syntax of fluid works because the path is rendered correctly.

History

Updated by Bastian Waidelich about 2 years ago

  • Project changed from TYPO3.Fluid to Extbase MVC Framework
  • Category deleted (ViewHelpers)

Updated by Bastian Waidelich about 2 years ago

  • Category set to 965
  • Status changed from New to Closed
  • Assignee set to Bastian Waidelich

He Michael,

thanks for reporting and sorry for the late reaction ;)
The behavior is actually expected:
ChildNodes are escaped by default (unless you set $escapingInterceptorEnabled = FALSE; in the ViewHelper or change the ViewHelper configuration in your view).
The ViewHelper arguments are not wrapped because you need to have access to the raw content within the ViewHelper.
Why you were confused is probably because of this:
The equivalent of
1 <f:cObject typoscriptObjectPath="lib.ext.lightboxImage" data="{image.fullPath}" />
is not
1 {f:cObject(typoscriptObjectPath: 'lib.ext.lightboxImage' data: '{image.fullPath}')}
as in your example but actually
1 {f:cObject(typoscriptObjectPath: 'lib.ext.lightboxImage' data: image.fullPath)}

And in that case the result should be the same.

Feel free to re-open the issue if that's not the case

Updated by Anja Leichsenring 5 months ago

  • Project changed from Extbase MVC Framework to Fluid
  • Category changed from 965 to Fluid

Also available in: Atom PDF