Issue Bug Rejected

#39302PHP Warning: Invalid argument supplied for foreach() in t3lib/class.t3lib_timetrack.php line 397, 404, 436

Philipp Gampe 07/26/12, 20:01 updated 12/12/14, 17:57

Description

To reproduce, use the admin penal and enable “tree display” and “display all times”.

Call Stack
#    Time    Memory    Function    Location
1    0.0002    245968    {main}( )    ../index.php:0
2    0.0029    1977104    require( '/home/phil/t3-playground/t3-git/typo3/sysext/cms/tslib/index_ts.php' )    ../index.php:42
3    2.5471    23060512    t3lib_tsfeBeUserAuth->displayAdminPanel( )    ../index_ts.php:305
4    2.5471    23060560    tslib_AdminPanel->display( )    ../class.t3lib_tsfebeuserauth.php:183
5    2.5478    23118680    tslib_AdminPanel->getTSDebugModule( )    ../class.tslib_adminpanel.php:268
6    2.5484    23122880    t3lib_timeTrack->printTSlog( )    ../class.tslib_adminpanel.php:544
7    2.5494    23142936    t3lib_timeTrack->fixContent( )    ../class.t3lib_timetrack.php:262
8    2.5494    23143576    xdebug_print_function_stack ( )    ../class.t3lib_timetrack.php:396

fixContent() seems to insert the actual tree elements into the admin panel and is called the first time by printTSlog() and later recursively by itself.

The actual calling line is:

            // Parsing the registeret content and create icon-html for the tree
        $this->tsStackLog[$arr['0.'][0]]['content'] = $this->fixContent($arr['0.']['0.'], $this->tsStackLog[$arr['0.'][0]]['content'], '', 0, $arr['0.'][0]);

The key $arr['0.']['0.'] does not exist. Thus I changed it to:

            // Parsing the registered content and create icon-html for the tree
        $this->tsStackLog[$arr['0.'][0]]['content'] = $this->fixContent($arr['0.'], $this->tsStackLog[$arr['0.'][0]]['content'], '', 0, $arr['0.'][0]);

And it seems to work again.

However, this line was not modified since the initial commit by Kasper, nor was the surrounding code much modified.

git blame -L 261,262 t3lib/class.t3lib_timetrack.php |cat
c32f068c (Kasper Skårhøj 2004-09-09 02:26:26 +0000 261)             // Parsing the registeret content and create icon-html for the tree
c32f068c (Kasper Skårhøj 2004-09-09 02:26:26 +0000 262)         $this->tsStackLog[$arr['0.'][0]]['content'] = $this->fixContent($arr['0.']['0.'], $this->tsStackLog[$arr['0.'][0]]['content'], '', 0, $arr['0.'][0]);

Thus I wonder when it broke.

Can someone reduce this on lower branches than 6.0?

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.