Bug #53898
Unused code in PageLayoutView (~100 lines)
Status: | Resolved | Start date: | 2013-11-23 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 100% |
|
Category: | Code Cleanup | Spent time: | - | |
Target version: | 7.1 (Cleanup) | |||
TYPO3 Version: | 6.2 | Is Regression: | No | |
PHP Version: | 5.3 | Sprint Focus: | On Location Sprint | |
Complexity: |
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)
Related issues
Associated revisions
[TASK] Remove unused code in PageLayoutView.php
Changing the backend view to use grid elements caused an ancient
piece of code in PageLayoutView.php to be never executed. In fact
an if statement in PageLayoutController.php always evaluates to
"FALSE" which lets the code in PageLayoutView.php never get
executed.
Change-Id: I4f97690b54efeb7659f86f1ef15fa8603e97f69b
Resolves: #53898
Releases: master
Reviewed-on: http://review.typo3.org/25662
Reviewed-by: Jo Hasenau <info@cybercraft.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Frederic Gaus <frederic.gaus@flagbit.de>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
History
#1 Updated by Gerrit Code Review over 1 year 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 over 1 year 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 over 1 year 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 over 1 year 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 over 1 year 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 over 1 year 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 1 year 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 10 months 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 7 months ago
- Target version changed from next-patchlevel to 7.1 (Cleanup)
#10 Updated by Anja Leichsenring 6 months ago
- Sprint Focus set to On Location Sprint
#11 Updated by Gerrit Code Review 6 months 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 6 months 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 5 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 1e6df9d0a0c158ac2e686cce76144eb5bd9c9405.