Project

General

Profile

Actions

Bug #17237

closed

Fatal error: Cannot use string offset as an array in C:\xampp\htdocs\dev\TYPO\dummy\t3lib\class.t3lib_flexformtools.php on line

Added by Sebastian Böttger almost 17 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2007-04-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
5.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

bug_5488.diff (876 Bytes) bug_5488.diff Administrator Admin, 2007-05-03 23:35
malformed_flexdata.jpg (96.8 KB) malformed_flexdata.jpg Administrator Admin, 2009-02-04 14:08

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #64914: Cleaner scripts crashes due to incomplete flexform contentClosedJose Antonio Guerra2015-02-06

Actions
Related to TYPO3 Core - Bug #66309: Refindex fixer: crash with broken flexform on deleted pageClosed2015-04-07

Actions
Has duplicate TYPO3 Core - Bug #18472: Cleaner scripts crash with errors due to malformed flexform contentClosedChristian Kuhn2008-03-18

Actions
Actions #1

Updated by Sebastian Böttger almost 17 years ago

It is line 252 in class.t3lib_flexformtools.php

Actions #2

Updated by Sebastian Böttger almost 17 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

Actions #3

Updated by Sebastian Böttger almost 17 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.

Actions #4

Updated by Sebastian Böttger almost 17 years ago

Got it fixed. Unified Diff as Attachment

Actions #5

Updated by Sebastian Böttger almost 17 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.

Actions #6

Updated by Francois Suter about 15 years ago

Can you explain how I can reproduce this bug? Where should I put an umlaut and what action should I take afterwards?

Actions #7

Updated by Peter Kuehn about 15 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

Actions #8

Updated by Peter Kuehn about 15 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.

Actions #9

Updated by Peter Kuehn about 15 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.

Actions #10

Updated by Susanne Moog over 12 years ago

  • Target version deleted (0)

Is this still an issue?

Actions #11

Updated by Francois Suter over 12 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.

Actions #12

Updated by Benni Mack over 12 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.

Actions #13

Updated by Francois Suter over 12 years ago

  • Status changed from Needs Feedback to Closed
Actions #14

Updated by Georg Ringer about 4 years ago

  • Related to Bug #66309: Refindex fixer: crash with broken flexform on deleted page added
Actions

Also available in: Atom PDF