Bug #6338

JSON is being parsed as string Array

Added by Rens Admiraal over 5 years ago. Updated about 2 years ago.

Status:Closed Start date:2010-02-04
Priority:Could have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:- Estimated time:10.00 hours
Has patch: Affected Flow version:

Description

We have a fluid template with some inline javascript. The JSON objects in it are being parsed as the literal string 'Array'.

It looks like fluid is parsing all array notations in the content instead of just parsing the arrays used in the viewhelper parameters. There is a workaround for this bug, just add a property to the json containing a viewhelper.

Not working:
flashes.push({
id: 'sponsorMeter',
flashvars: {
amount:5000,
maxAmount:700,
link: "<f:uri.action pageUid='{pages.sponsor}' absolute='true' />",
type:'zip'
},
parameters: {
wmode:'transparent'
},
width: 150,
height: 260,
src:'/<f:uri.resource path="Flash/sponsormeter.swf" />'
});

Working (parameters objects has changed):
flashes.push({
id: 'sponsorMeter',
flashvars: {
amount:5000,
maxAmount:700,
link: "<f:uri.action pageUid='{pages.sponsor}' absolute='true' />",
type:'zip'
},
parameters: {
link: "<f:uri.action pageUid='{pages.sponsor}' absolute='true' />",
wmode:'transparent'
},
width: 150,
height: 260,
src:'/<f:uri.resource path="Flash/sponsormeter.swf" />'
});


Related issues

related to TYPO3.Fluid - Feature #39682: Disregegard { as Fluid variable when followed by a white ... Rejected 2012-08-10
duplicated by TYPO3.Fluid - Bug #8879: { } when using as JavaScript Closed 2010-07-15

History

#1 Updated by Sebastian Kurfuerst over 5 years ago

  • Status changed from New to Accepted
  • Assigned To set to Sebastian Kurfuerst

#2 Updated by Sebastian Kurfuerst over 5 years ago

  • Target version set to 1.0.0 alpha 8
  • Estimated time set to 10.00
  • Branch set to v4 + v5

#3 Updated by Sebastian Kurfuerst about 5 years ago

  • Status changed from Accepted to New
  • Assigned To deleted (Sebastian Kurfuerst)
  • Priority changed from Must have to Could have
  • Target version deleted (1.0.0 alpha 8)

we just discussed this again; and as there are workarounds (CDATA), we agreed upon not implementing this right now.
We first need proper testing for the syntax, and it would make the parser context sensitive.

#4 Updated by Bastian Waidelich about 5 years ago

  • Status changed from New to Closed

As there are workarounds (wrapping your scripts in CDATA tags) I close this issue for now.
If you don't agree or want to discuss this further, please re-open!

Also available in: Atom PDF