Project

General

Profile

Actions

Bug #53898

closed

Unused code in PageLayoutView (~100 lines)

Added by Bernhard Kraft almost 11 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Code Cleanup
Target version:
Start date:
2013-11-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

There is an "if" statement [1] which can never be true. The "!" operator binds stronger than "===" which results in the left part of the evaluation to be either TRUE or FALSE - but never "4".

Because of this the linked code block: [2] will never get executed (~100 lines)

In fact this block/piece of code isn't even working properly. Nowadays only the grid is used for PageLayout and as it is know the configuration "mod.SHARED.colPos_list" is not available anymore. So the variable "$this->colPosList" always gets set from the current backend layout [3]. Additionally I couldn't find a place where "$this->MOD_SETTINGS['function']" ever gets set to "4". As mentioned: Grid view is used by default.

Testing: Create a backend layout with only one column and assign it to a page. Change the above mentioned if statement to:

if (TRUE || count($colList) === 1 && !$this->MOD_SETTINGS['function'] === 4) {

Now open the page with the page module: You are now looking at an ancient view of the TYPO3 page module which you probably haven't seen for years.

Solution: Remove the mentioned if statement and code block (around 100 lines)

[1] source:typo3/sysext/backend/Classes/Controller/PageLayoutController.php@51e23edaf7d518e05293874ac4b631db77594da9#L907

[2] source:typo3/sysext/backend/Classes/View/PageLayoutView.php@51e23edaf7d518e05293874ac4b631db77594da9#L649

[3] source:typo3/sysext/backend/Classes/Controller/PageLayoutController.php@51e23edaf7d518e05293874ac4b631db77594da9#L529


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #39967: mod.SHARED.colPos_list is not taken into account any moreClosed2012-08-19

Actions
Actions

Also available in: Atom PDF