[BUGFIX] Show first tab in Element Wizard as fallback 67/42767/5
authorChristian Seifert <christian-f-seifert@gmx.de>
Thu, 20 Aug 2015 22:59:29 +0000 (22:59 +0000)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 21 Aug 2015 07:16:36 +0000 (09:16 +0200)
commit304ce31cd6623a9170bd1176a55a772bd6c68366
tree2131a333f56b7cb501bd6308e85c18b10119ce8b
parentacbcaa6809ac0ebda96f328354a33d3a921c5a77
[BUGFIX] Show first tab in Element Wizard as fallback

Using the extension gridelements it is possible to restrict the
selectable content elements instead of the full menu configured
by TSconfig. At first, you might have 5 menus available and you
click on the last menu tab (maybe the fifth), so the backend
stores 5 as current tab.
Adding content elements within a gridelement, which restricts the
range of selectable CEs, you can only select the first tab (p.e.).
The original code assumes that the fifth tab is still there and
tries to select it.

This patch checks first against the existence of the selected tab.
If there is no "fifth" tab p.e. the index is set to 1.

Resolves: #59810
Releases: master, 6.2
Change-Id: I829489737de4631dfe3362e4fb11909be9315864
Reviewed-on: http://review.typo3.org/42767
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Resources/Public/JavaScript/tabmenu.js