Project

General

Profile

Actions

Bug #71394

closed

GeneralUtility::array2xml(): Empty arrays are encoded as whitespace

Added by Andreas Wolf about 9 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2015-11-07
Due date:
% Done:

100%

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

Description

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">        </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.

In most situations, the type="array" will mitigate the negative effects. For certain Flexform constellations however, this will not be used, making it impossible to resolve the type properly.

Actions #1

Updated by Andreas Wolf about 9 years ago

  • Description updated (diff)
Actions #2

Updated by Andreas Wolf about 9 years ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review about 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44599

Actions #4

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44599

Actions #5

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44600

Actions #6

Updated by Anonymous about 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Gerrit Code Review about 9 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44601

Actions #8

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44600

Actions #9

Updated by Anonymous about 9 years ago

  • Status changed from Under Review to Resolved
Actions #10

Updated by Gerrit Code Review about 9 years ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44601

Actions #11

Updated by Gerrit Code Review about 9 years ago

Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44601

Actions #12

Updated by Gerrit Code Review about 9 years ago

Patch set 4 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44601

Actions #13

Updated by Anonymous about 9 years ago

  • Status changed from Under Review to Resolved
Actions #14

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF