[TYPO3-core] RFC: fix bug #2722 and #2837

Franz Holzinger franz at fholzinger.com
Mon Mar 20 13:27:30 CET 2006


Hello Martin,

>Franz Holzinger <franz at fholzinger.com> writes on 
>Mon, 20 Mar 2006 12:02:58 +0100 (MET):
>
>  
>
>>This is a CVS bugfix request:
>>
>>
>>http://bugs.typo3.org/view.php?id=2722
>>http://bugs.typo3.org/view.php?id=2837
>>
>>The table wizard gives error messages under PHP 5.1.2 because of not
>>defined arrays when it tries to access its elements.
>>
>>I have observed from the code that $this->tableParsing_delimiter has
>>not be initialized. This would be missing if the record has not been
>>stored yet.
>>    
>>
>
>
>You added the initializing
>$this->tableParsing_delimiter = '|';
>but no 
>$this->tableParsing_quote = '';
>  
>
ok

>I think this is longer than necessary:
>
>if (is_array($flexForm) && is_array($flexForm['data']) && is_array($flexForm['data']['s_parsing']) && is_array($flexForm['data']['s_parsing']['lDEF'])) 
>
>After saving $flexForm is an array. So IMHO this code is sufficient:
>
>if (is_array($flexForm) {
>$this->tableParsing_quote = $flexForm['data']['s_parsing']['lDEF']['tableparsing_quote']['vDEF']?chr(intval($flexForm['data']['s_parsing']['lDEF']['tableparsing_quote']['vDEF'])):'';
>$this->tableParsing_delimiter = $flexForm['data']['s_parsing']['lDEF']['tableparsing_delimiter']['vDEF']?chr(intval($flexForm['data']['s_parsing']['lDEF']['tableparsing_delimiter']['vDEF'])):'|';
>}
>
>  
>
ok

>I still haven't changed to PHP5 in production yet. Is there really no way to test a nested array? Like is_XXX($foo['a']['b']['c'])
>
>Those multiple tests are horrible. They are not readable and are a waste of CPU cycles.
>  
>
Yes, it would be fine to have the PHP4 behaviour also with PHP5 where no
check of an array would be necessary at all. It should just return NULL
and not create any error message. However if it goes to PHP5 then a
try-catch clause can be written.

Regards,

Franz







-------------- next part --------------
A non-text attachment was scrubbed...
Name: wizard_table.diff
Type: text/x-patch
Size: 1887 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060320/64f6d71a/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: error-typo9-1.png
Type: image/png
Size: 5430 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060320/64f6d71a/attachment.png 


More information about the TYPO3-team-core mailing list