Project

General

Profile

Actions

Bug #16179

closed

Fatal error with flexform fields in a database.

Added by Morten Hansen almost 18 years ago. Updated almost 16 years ago.

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

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I have been able to produce this fatal error:

Fatal error: Cannot use string offset as an array in /home/www/cms/typo3_src-4.0/t3lib/class.t3lib_tcemain.php on line 1950

And I think it is a bug in the way the typo3 core handles the flexforms.

I have some events with a flexform field used to link price categories with a specific price in the specific event.

The XML data saved in this field could be this:


<T3FlexForms>
<data>
<sheet index="sDEF">
<language index="lDEF">
<field index="field_pricingsection">
<el index="el">
<section index="1">
<itemType index="field_pricingcontainer">
<el>
<field index="field_category">
<value index="vDEF">13</value>
</field>
<field index="field_price">
<value index="vDEF">0</value>
</field>
</el>
</itemType>
</section>
</el>
</field>
</language>
</sheet>
</data>
</T3FlexForms>

Then if I delete this element (consisting of a price category and a price), it only deletes this element not the section called field_pricingsection.
I think this is quite logical since it can delete the section unless it knows that there is not any other elements left in the section. The resulting XML is this:


<T3FlexForms>
<data>
<sheet index="sDEF">
<language index="lDEF">
<field index="field_pricingsection">
<el index="el">
</el>
</field>
</language>
</sheet>
</data>
</T3FlexForms>

Now, the issue arises when I try to create a price category and price relation again (like the first shown XML)

The error arises because typo3 can see that there is a section (it was not deleted when the last element was deleted), and then it accesses the content of this without checking that there is some content there.

/home/www/cms/typo3_src-4.0/t3lib/class.t3lib_tcemain.php on line 1950

I am not an expert in flexforms handling, but one solution would be to include a check for existing elements in dataValues_current around line 1950 in tcemain class.

(issue imported from #M3552)


Files

bug_3552.diff (899 Bytes) bug_3552.diff Administrator Admin, 2007-07-07 00:50

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #16381: DB Check cron produces errorsClosedDmitry Dulepov2006-07-20

Actions
Has duplicate TYPO3 Core - Bug #17467: Fatal error with flexform fields in a database.ClosedOliver Hader2007-07-12

Actions
Actions

Also available in: Atom PDF