Project

General

Profile

Bug #71394

Updated by Andreas Wolf almost 9 years ago

When encoding an empty array as XML (e.g. an empty Flexform container from which all sections have been removed), the empty array will be encoded as (linebreaks stripped) @<el index="el"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</el>@.          </el>@. This leads to the object not being treated as an empty array on decoding, but as a nonempty string. 

 In some situations, such a non-empty string leads to undesirable results, e.g. when passing it to Fluid’s @f:for@ view helper, where it will trigger a warning because it is not iterable. 

 The root cause can be found in GeneralUtility::array2xml(), where the value of array elements is prepended with indentation no matter the size of the array. Instead, empty elements should be dropped. situations

Back