Bug #39302

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

Added by Philipp Gampe 11 months ago. Updated 10 months ago.

Status:New Start date:2012-07-26
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
TYPO3 Version:6.0 Complexity:hard
PHP Version:5.4
Votes: 1 (View)

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:

1            // Parsing the registeret content and create icon-html for the tree
2         $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:

1            // Parsing the registered content and create icon-html for the tree
2         $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?

History

Updated by Philipp Gampe 11 months ago

I have the patch ready to push, but would like to get feedback about effected branches and whether some other place needs to be changed instead.

Updated by Markus Klein 11 months ago

Hi!
This is indeed very strange. I tracked down the usage of $arr and $this->tsStackLog and $this->createHierarchyArray(). No noteworthy changes have taken place.

Updated by Philipp Gampe 11 months ago

It must be some kind of other magic that results in one nesting level less than it was before.
If I am bored tonight, I will play around with older versions and maybe do a git bisect. But it makes some trouble switching back and forth between certain versions due to different caches and configuration handling ;)

Also available in: Atom PDF