[TYPO3-core] RFC: #3725: impexp has problem with flexform
Franz Holzinger
franz at fholzinger.com
Fri Jun 30 11:36:24 CEST 2006
Hello Martin,
>Franz Holzinger schrieb:
>
>
>>This is a CVS patch request.
>>
>>Most of the stuff below is taken from
>>http://bugs.typo3.org/view.php?id=3725
>>
>>Branches: 4.0
>>
>>Type: Bugfix
>>
>>Description:
>>The import with impexp causes a problem which comes from a string wrongly used as an array in PHP5. The import tool does not inform the user about warning messages in the T3D file.
>>
>>These patches can solve this.
>>
>>The error occurs when the flexform has:
>>
>>$xmlData <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
>><T3FlexForms>
>><meta>
>></meta>
>><data>
>>
>>
>
>You try to capture this with this test:
>
>if (strcmp($editData['meta'],'')) {
> $editData['meta'] = array();
>}
>
>But what happens when I have this:
>
><meta>foobar</meta>
>
>Now meta is not an empty string but still no array which seem to be a problem.
>
>How about to catch the condition like this:
>
> // empty or invalid <meta>
>if (!is_array($editData['meta'])) {
> $editData['meta'] = array();
>}
>
>
>
ok.
>I don't get why you do an fgets() here:
>
>} else $this->error('File read error: Warning message in file.
>('.$initStr.fgets($fd).')');
>
>
>
This is because only the first characters of the error message from the
input T3D have been read at this moment. So there would follow other
characters of this error message with the next
$initStr = fread($fd, $initStrLen);
Therefore I read in all the error string to get it totally at this
moment and not partially again later.
- Franz
More information about the TYPO3-team-core
mailing list