[BUGFIX] Bookmarks to pages don't work
authorStefan Galinski <stefan.galinski@gmail.com>
Fri, 3 Feb 2012 17:22:49 +0000 (18:22 +0100)
committerStefan Galinski <stefan.galinski@gmail.com>
Wed, 8 Feb 2012 20:53:52 +0000 (21:53 +0100)
Change-Id: I25fce6d672ffe890d494222ed4ea8a2500c5bfac
Fixes: #30352
Releases: 4.7. 4.6, 4.5
Reviewed-on: http://review.typo3.org/8830
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stefan Galinski
Tested-by: Stefan Galinski
t3lib/js/extjs/components/pagetree/javascript/Ext.ux.state.TreePanel.js

index 8ff3c54..5233467 100644 (file)
@@ -95,22 +95,26 @@ Ext.override(Ext.ux.state.TreePanel, {
                                        }
                                }
                                        // get last selected node
+
                                if (this.stateHash['lastSelectedNode']) {
                                        var node = this.getNodeById(this.stateHash['lastSelectedNode']);
                                        if (node) {
-                                               this.selectPath(node.getPath());
-
                                                var contentId = TYPO3.Backend.ContentContainer.getIdFromUrl() ||
                                                        String(fsMod.recentIds['web']) || '-1';
 
+                                               var hasContentFrameValidPageId = (contentId !== '-1' && contentId !== '0');
                                                var isCurrentSelectedNode = (
                                                        String(node.attributes.nodeData.id) === contentId ||
                                                        contentId.indexOf('pages' + String(node.attributes.nodeData.id)) !== -1
                                                );
 
-                                               if (contentId !== '-1' && !isCurrentSelectedNode && this.app.isVisible() &&
-                                                       this.commandProvider && this.commandProvider.singleClick
-                                               ) {
+                                               if (isCurrentSelectedNode) {
+                                                       this.selectPath(node.getPath());
+                                               }
+
+                                               var isSingleClickPossible = (this.app.isVisible() && this.commandProvider && this.commandProvider.singleClick);
+                                               if (!hasContentFrameValidPageId && !isCurrentSelectedNode && isSingleClickPossible) {
+                                                       this.selectPath(node.getPath());
                                                        this.commandProvider.singleClick(node, this);
                                                }
                                        }