[TYPO3-core] RFC: fix bug #2722 and #2837
Martin Kutschker
Martin.Kutschker at blackbox.net
Mon Mar 20 12:57:14 CET 2006
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.
So it is for a flex form based stuff.
Notes:
You added the initializing
$this->tableParsing_delimiter = '|';
but no
$this->tableParsing_quote = '';
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'])):'|';
}
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.
Masi
More information about the TYPO3-team-core
mailing list