Bug #17237
closedFatal error: Cannot use string offset as an array in C:\xampp\htdocs\dev\TYPO\dummy\t3lib\class.t3lib_flexformtools.php on line
0%
Description
I tried to export an t3d file. I tried it using the TV Page module AND the normal page module.
Fatal error: Cannot use string offset as an array in C:\xampp\htdocs\dev\TYPO\dummy\t3lib\class.t3lib_flexformtools.php on line
(issue imported from #M5488)
Files
Updated by Sebastian Böttger almost 18 years ago
It is line 252 in class.t3lib_flexformtools.php
Updated by Sebastian Böttger almost 18 years ago
I'm sorry. I use stable version 4.1, not RC. But I guess it is in the RC version, too. Because I found it also in the version 4.0.5
Updated by Sebastian Böttger almost 18 years ago
Meanwhile I found out what exactly goes wrong:
ath this function call:
$this->traverseFlexFormXMLData_recurse(
$value['el'],
$editData[$key]['el'],
$PA,
$path.'/'.$key.'/el'
);
$editData is not an array. so if you just surround it with
if (is_array($editData)){...} you won't et this error anymore. but if you choose some changes and try to update after this, you will get a blank screen.
Updated by Sebastian Böttger almost 18 years ago
Got it fixed. Unified Diff as Attachment
Updated by Sebastian Böttger almost 18 years ago
Finally I found out how you can reproduce this error.
The problem is a erroneous data structure (xml). I used german Umlauts ä ö ü, and therefore the parser will ends up with an error in line xy. But TYPO3 won't notice this, and therefore will just say the editData is empty.
Imho you can fix this likeI did, because I could export and import the project after I inserted the fix above, and the project worked like before.
Updated by Francois Suter about 16 years ago
Can you explain how I can reproduce this bug? Where should I put an umlaut and what action should I take afterwards?
Updated by Peter Kuehn about 16 years ago
Hi Francois,
I guess the suggested patches will not fix the problem:
You would have to test if $editData is an array, $editData[$key] is an array and $value is an array for both calls - the recursion and the call to $this->callBackObj->$PA['callBackMethod_value'] since all of this three may become strings in somehow broken content .
If you do so, the fatal error is no longer spit in flexformtools, but may occur in class.tx_templavoila_htmlmarkup.php line 540 (FE) and class.t3lib_tceforms.php on line 2595 (BE, editing of the record).
I found german umlauts in my content as well, but there are tons of working flexdata with umlauts while others break.
investigation continues ;)
gRTz
pekue
Updated by Peter Kuehn about 16 years ago
trying lowlevel_cleaner cleanflexform:
needs the suggested fixes to work and seems to fix the xml to no longer break in FE or BE editing.
Updated by Peter Kuehn about 16 years ago
@lowlevel_cleaner cleanflexform
it uses t3lib_flexformtools->cleanFlexFormXML() to re-render a former malformed rendered flexdata xml. cleanFlexFormXML() sets the internal variable reNumberIndexesOfSectionData hardcoded to true, which imho results in something comparable to reordering auto_increment field entries in a database table....
I attached a debug output of a flexdata xml converted to an array.
the entry field_picwithsub - why ever - does not contain the vDEF level.
afaik this may not happen by definition.
Since it can be parsed, I dont think it got something todo with the suspected umlauts. Id rather bet on either TCEForms submitting data in an unexpected structure or TCEMain handling them in a wrong way.
Updated by Francois Suter over 13 years ago
Tried to come back to this old bug report (with a TYPO3 4.6 install). I'm not sure where the umlauts are supposed to be to break anything, but I created a field call "field_gütenberg" in my TV data structure and it didn't break anything, neither on the mapping, nor the usage (in the page module), nor on export or import.
Note that I actually had to rename this field manually, because the TV mapping module doesn't even allow special characters in the field names.
I suggest to close this issue.
Updated by Benni Mack over 13 years ago
Hey,
yes. seems to me like a charset problem anyway, and that shouldn't be an issue with 4.5+ anymore anyway.
Can we close this issue and also the duplicate?
All the best,
Benni.
Updated by Francois Suter over 13 years ago
- Status changed from Needs Feedback to Closed
Updated by Georg Ringer about 5 years ago
- Related to Bug #66309: Refindex fixer: crash with broken flexform on deleted page added