Project

General

Profile

Actions

Bug #39302

closed

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

Added by Philipp Gampe over 12 years ago. Updated almost 10 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-07-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
5.4
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

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?


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #41213: Tree view in admin panel is broken on PHP 5.4ClosedPhilipp Gampe2012-09-21

Actions
Actions #1

Updated by Philipp Gampe over 12 years 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.

Actions #2

Updated by Markus Klein over 12 years 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.

Actions #3

Updated by Philipp Gampe over 12 years 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 ;)

Actions #4

Updated by Alexander Opitz almost 10 years ago

  • Status changed from New to Needs Feedback
  • Is Regression set to No

Hi,

as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?

Actions #5

Updated by Philipp Gampe almost 10 years ago

  • Status changed from Needs Feedback to Rejected
Actions

Also available in: Atom PDF