Bug #53898

Unused code in PageLayoutView (~100 lines)

Added by Bernhard Kraft almost 8 years ago. Updated about 4 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

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

Actions
#1

Updated by Gerrit Code Review almost 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25662

#2

Updated by Gerrit Code Review almost 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25662

#3

Updated by Gerrit Code Review almost 8 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25662

#4

Updated by Gerrit Code Review almost 8 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25662

#5

Updated by Gerrit Code Review almost 8 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25662

#6

Updated by Jo Hasenau almost 8 years ago

Actually colPosList should still be available, although it is not, due to a regression linked in #39967.

So before removing this piece of code, I would like to discuss that further.

#7

Updated by Markus Klein over 7 years ago

@Jo:

Bernhard Kraft wrote about this patch on gerrit:

I am not really sure but if I remember it correctly the issue you linked to has nothing to do with this one.
This one is about the "single column view" which is not available since 4.? ... It is an ancient feature of TYPO 3.x
The "function" menu can not even get set to "4" as this option is removed. Let's wait for the result of the discussion you linke to - then take further steps.

#8

Updated by Gerrit Code Review about 7 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/25662

#9

Updated by Mathias Schreiber almost 7 years ago

  • Target version changed from next-patchlevel to 7.1 (Cleanup)
#10

Updated by Anja Leichsenring almost 7 years ago

  • Sprint Focus set to On Location Sprint
#11

Updated by Gerrit Code Review over 6 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/25662

#12

Updated by Gerrit Code Review over 6 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/25662

#13

Updated by Jan Helke over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#14

Updated by Anja Leichsenring almost 6 years ago

  • Sprint Focus deleted (On Location Sprint)
#15

Updated by Riccardo De Contardi about 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF