« Previous | Next » 

Revision ba09ec53

IDba09ec53d0fc932e4d65a4acfd925398e058b37e

Added by Sebastian Kurfuerst about 9 years ago

[!!!][FEATURE] Allow Fluid arrays only in ViewHelper arguments

This change greatly enhances the JavaScript compatibility of Fluid.

Fluid Arrays are a subset of the JavaScript object syntax, making it
hard to work with them in mixed HTML/JavaScript documents. For example
before this change, the following JavaScript Object was parsed by Fluid::

var uris = {
endPoint1: '{f:uri.action(…)}',
endPoint2: '{f:uri.action(…)}',
};

Before this change, the above snippet resulted in the following template,
as the generated array was casted to a string:

var uris = Array

With this change, Fluid only parses arrays which are used inside
ViewHelper arguments, such that an array inside normal text is not
converted anymore.

Breaking Change ===============

This change is only breaking in very rare cases where one relied on
the inner contents of the ViewHelper being an array, f.e. if one used
the debug ViewHelper as follows::

<f:debug>{key1: 'value1', key2: 'value2'}</f:debug>

… or if anybody wrote custom ViewHelpers which use this convention.

Relying on that would be very fragile anyways, as the insertion of a
single space character before the opening curly bracket or after the
closing one would cast the array back to a string.

ViewHelpers which were written like this should be re-written to take
the array as ViewHelper argument::

<f:debug value="{key1: 'value1', key2: 'value2'}" />

Change-Id: I5a54a50dd1bb365486c6f59efcb966dc4e441c79
Resolves: #43356
Releases: 1.2

  • added
  • modified
  • copied
  • renamed
  • deleted