[BUGFIX] Define 0 as a valid page id in Ext.ux.state.TreePanel 76/48776/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 2 Jul 2016 10:35:03 +0000 (12:35 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 6 Jul 2016 10:16:31 +0000 (12:16 +0200)
According to the ExtJS TreePanel, -1 and 0 are invalid page ids. However,
having bookmarks linking to pid=0 causes problems, as 0 is detected as
invalid and the user gets redirected to the first available node.

This patch defines 0 as a valid page id.

Resolves: #76480
Releases: master, 7.6
Change-Id: Idbe6590d910078a971046e47f0d436af183d68ce
Reviewed-on: https://review.typo3.org/48776
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/Ext.ux.state.TreePanel.js

index 3d744c2..740d39e 100644 (file)
@@ -93,7 +93,7 @@ Ext.override(Ext.ux.state.TreePanel, {
                                                var contentId = TYPO3.Backend.ContentContainer.getIdFromUrl() ||
                                                        String(fsMod.recentIds['web']) || '-1';
 
-                                               var hasContentFrameValidPageId = (contentId !== '-1' && contentId !== '0');
+                                               var hasContentFrameValidPageId = contentId !== '-1';
                                                var isCurrentSelectedNode = (
                                                        String(node.attributes.nodeData.id) === contentId ||
                                                        contentId.indexOf('pages' + String(node.attributes.nodeData.id)) !== -1