[BUGFIX] Page tree nodes can be (un)mounted again 06/54706/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 20 Nov 2017 18:55:06 +0000 (19:55 +0100)
committerFrank Naegler <frank.naegler@typo3.org>
Wed, 22 Nov 2017 11:57:23 +0000 (12:57 +0100)
(Un)mounting nodes in the page tree is now possible again by fixing calls
to the page tree objects.

Resolves: #83051
Releases: master, 8.7
Change-Id: I978308e301b712fa75d677337d790e4895dc997a
Reviewed-on: https://review.typo3.org/54706
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/ContextMenuActions.js
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/actions.js

index 41ff48d..6d6ed48 100644 (file)
@@ -47,8 +47,8 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal', 'TYPO3/CMS/Backend/Severity'], func
     ContextMenuActions.mountAsTreeRoot = function (table, uid) {
         // see actions.js -> mountAsTreeRoot
         if (table === 'pages' && typeof top.Ext.getCmp('typo3-pagetree') !== 'undefined') {
-            var node = top.Ext.getCmp('typo3-pagetree-tree').app.getSelected();
-            // var node = top.TYPO3.Backend.NavigationContainer.PageTree.getSelected();
+            var app = top.Ext.getCmp('typo3-pagetree-tree').app;
+            var node = app.getTree().getRootNode().findChild('realId', uid, true);
             if (node === null) {
                 return false;
             }
index 2cfc3c4..8c6229b 100644 (file)
@@ -276,26 +276,27 @@ require(['TYPO3/CMS/Backend/Utility'], function(Utility) {
                        TYPO3.Components.PageTree.Commands.setTemporaryMountPoint(
                                node.attributes.nodeData,
                                function (response) {
+                                       var app = Ext.getCmp('typo3-pagetree-tree').app;
                                        if (TYPO3.Components.PageTree.Configuration.temporaryMountPoint) {
-                                               TYPO3.Backend.NavigationContainer.PageTree.removeIndicator(
-                                                       TYPO3.Backend.NavigationContainer.PageTree.temporaryMountPointInfoIndicator
+                                               app.removeIndicator(
+                                                       app.temporaryMountPointInfoIndicator
                                                );
                                        }
 
                                        TYPO3.Components.PageTree.Configuration.temporaryMountPoint = response;
-                                       Ext.getCmp('typo3-pagetree-tree').app.addTemporaryMountPointIndicator();
+                                       app.addTemporaryMountPointIndicator();
 
-                                       var selectedNode = Ext.getCmp('typo3-pagetree-tree').app.getSelected();
+                                       var selectedNode = app.getSelected();
                                        tree.stateId = 'Pagetree' + TYPO3.Components.PageTree.Configuration.temporaryMountPoint;
                                        tree.refreshTree(function () {
                                                var nodeIsSelected = false;
                                                if (selectedNode) {
-                                                       nodeIsSelected = TYPO3.Backend.NavigationContainer.PageTree.select(
+                                                       nodeIsSelected = app.select(
                                                                selectedNode.attributes.nodeData.id
                                                        );
                                                }
 
-                                               var node = (nodeIsSelected ? TYPO3.Backend.NavigationContainer.PageTree.getSelected() : null);
+                                               var node = (nodeIsSelected ? app.getSelected() : null);
                                                if (node) {
                                                        this.singleClick(node, tree);
                                                } else {