Bug #59368

Nested Flexforms throw Exception

Added by Thomas Christiansen about 8 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-06-05
Due date:
% Done:

100%

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

Description

Having a nested Flexform results in this Exception:

Uncaught TYPO3 Exception
#1: PHP Warning: substr() expects parameter 1 to be string, array given in /var/www/dev.e-net.info/vhosts/caretaker/caretaker/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 2272 (More information)

TYPO3\CMS\Core\Error\Exception thrown in file
/var/www/dev.e-net.info/vhosts/caretaker/caretaker/typo3_src/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 111.

15 TYPO3\CMS\Core\Error\ErrorHandler::handleError(2, "substr() expects parameter 1 to be string, array given", "/var/www/dev.e-net.info/vhosts/caretaker/caretaker…po3/sysext/core/Classes/Utility/GeneralUtility.php", 2272, array)
14 substr(array, 0, 200)

/var/www/dev.e-net.info/vhosts/caretaker/caretaker/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php:
02270: // Default output charset is UTF-8, only ASCII, ISO-8859-1 and UTF-8 are supported!!!
02271: $match = array();
02272: preg_match('/^[[:space:]]*<\\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"/', substr($string, 0, 200), $match);
02273: $theCharset = $match1 ?: 'utf-8';
02274: // us-ascii / utf-8 / iso-8859-1

You might think why should i do that, but as you can see i am trying to get caretaker to work with 6.2. and it uses nested Flexforms to override test configurations.

Additionally i made a little test record to reproduce this behavior:

TCA:
...

'flexform' => array (
'label' => 'Flexform',
'config' => Array (
'type' => 'flex',
'ds' => array(
'default' => '
<T3DataStructure>
<ROOT>
<type>array</type>
<el>
<xmlTitle>
<TCEforms>
<label>The Title:</label>
<config>
<type>input</type>
<size>48</size>
</config>
</TCEforms>
</xmlTitle>
<flex>
<TCEforms>
<label>Nested Flexform</label>
<config>
<type>flex</type>
<ds>
<default>FILE:EXT:myext/Configuration/FlexForms/nested_flexform.xml</default>
</ds>
</config>
</TCEforms>
</flex>
</el>
</ROOT>
</T3DataStructure>
',
)
)
),

...

I already fixed this issue for me and i am going to push the patch to the review server in a minute.

Thanks,
Thomas

#1

Updated by Gerrit Code Review about 8 years ago

  • Status changed from New 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/30590

#2

Updated by Gerrit Code Review about 8 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/30590

#3

Updated by Gerrit Code Review about 8 years ago

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

#4

Updated by Gerrit Code Review about 8 years ago

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

#5

Updated by Gerrit Code Review about 8 years ago

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

#6

Updated by Gerrit Code Review about 8 years ago

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

#7

Updated by Anonymous about 8 years ago

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

Updated by Gerrit Code Review almost 8 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 http://review.typo3.org/32675

#9

Updated by Anonymous almost 8 years ago

  • Status changed from Under Review to Resolved
#10

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF