Bug #46049
closed
Fatal Error in FlexFormService->convertFlexFormContentToArray()
Added by Stefan Derungs over 11 years ago.
Updated over 4 years ago.
Description
When creating own Flexforms for extensions with different kind of field types (i.e. simple input/checkboxes/etc.), a fatal error occurs in class FlexFormService.
Fatal error: Cannot create references to/from string offsets nor overloaded objects in /.../typo3/sysext/extbase/Classes/Service/FlexFormService.php on line 58
The related code part:
public function convertFlexFormContentToArray($flexFormContent, $languagePointer = 'lDEF', $valuePointer = 'vDEF') {
...
} else {
$valueKeyParts = explode('.', $valueKey);
$currentNode =& $settings;
foreach ($valueKeyParts as $valueKeyPart) {
*$currentNode =& $currentNode[$valueKeyPart];* // Fatal error occurs in this line
}
...
}
I started wondering, if this is a bug of the current version (I use 6.0.2), as I can reproduce the error on several installations (with PHP 5.3.3) and the PHPUnit-Tests of Extbase only complete with errors.
Btw., it also doesn't matter of which type the flexform field is (input/int or input/select or check).
Files
- Status changed from New to Needs Feedback
Can you please provide some environment data of the server the error occures on? Furthermore an example of your Flexform and the plugin config using the Flexform would be helpful.
Very thanks
- Target version set to Extbase 6.0
- Target version changed from Extbase 6.0 to Extbase 6.3
Fatal error: Cannot create references to/from string offsets nor overloaded objects in /.../typo3/sysext/extbase/Classes/Service/FlexFormService.php on line 58
i think a have the same problem, i'm using [TYPO3 6.0.10], and i added a plugin Google map go_maps_ext v1.2.1
- Project changed from 534 to TYPO3 Core
- Category changed from Extbase: Core to Extbase
- Status changed from Needs Feedback to New
- Target version changed from Extbase 6.3 to 7.0
- TYPO3 Version set to 6.0
- Is Regression set to No
- Target version changed from 7.0 to 7.1 (Cleanup)
- Target version changed from 7.1 (Cleanup) to 7.4 (Backend)
- Target version changed from 7.4 (Backend) to 7.5
- Target version deleted (
7.5)
Backend
For me this error shows with flux based flexform plugins, as the backtrace shows that FluidTYPO3\Flux\Service\FluxService::convertFlexFormContentToArray is calling the FlexFormService.
Frontend
Frontend will show this error without flux, the backtrace shows that TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager->overrideConfigurationFromFlexForm is callinf the FlexFormService.
This error is triggered if the flexform content is mangled by changing the used plugins for a tt_content element instead of deleting and recreating the element.
Minimal flexform content to trigger the error for us is this (reduced from a live system):
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<T3FlexForms>
<data>
<sheet index="sDEF">
<language index="lDEF">
<field index="settings.links">
<el index="el">
</el>
</field>
<field index="settings.links.headline">
<value index="vDEF"></value>
</field>
</language>
</sheet>
</data>
</T3FlexForms>
Attached is a proposed patch to delegate the responsibility upstream.
The service will now throw an exception that needs to be handled by the caller (eg. FluxService)
Just silently discarding the error is not a valid option as the frontend plugin will not get the proper values the editor entered in the backend!
- Status changed from New to Needs Feedback
Can someone actually confirm this in TYPO3 v10? I cannot, because if I use the change from Sven, it kind-a fatals all the time. It seems like this is/was a PHP issue which is now fixed in PHP 7.2+?
- Status changed from Needs Feedback to Under Review
- Status changed from Under Review to Closed
after discussion, I recommend closing this issue - this seemed to be a PHP 5.x bug. Please let me know if we need to change something then I will re-open the ticket.
Also available in: Atom
PDF