[BUGFIX] Bookmarks to pages don't work
authorStefan Galinski <stefan.galinski@gmail.com>
Tue, 31 Jan 2012 20:40:05 +0000 (21:40 +0100)
committerStefan Galinski <stefan.galinski@gmail.com>
Fri, 3 Feb 2012 17:14:18 +0000 (18:14 +0100)
Change-Id: I1d253bae07b67d8a1cccba09de9666af252aad0a
Fixes: #30352
Releases: 4.7. 4.6, 4.5
Reviewed-on: http://review.typo3.org/8829
Reviewed-by: Stefan Galinski
Tested-by: Stefan Galinski
t3lib/js/extjs/components/pagetree/javascript/Ext.ux.state.TreePanel.js

index 348d94c..83bdd96 100644 (file)
@@ -98,22 +98,26 @@ Ext.override(Ext.ux.state.TreePanel, {
                                                }
                                        }
                                }
+
                                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);
                                                }
                                        }