Project

General

Profile

Actions

Bug #59368

closed

Nested Flexforms throw Exception

Added by Thomas Christiansen almost 10 years ago. Updated over 5 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

Actions

Also available in: Atom PDF