[BUGFIX] Page tree nodes can be (un)mounted again 23/54723/4
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 12:57:03 +0000 (13: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/54723
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.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 9420146..dd9b962 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 5553866..8a9552b 100644 (file)
@@ -271,30 +271,31 @@ TYPO3.Components.PageTree.Actions = {
         * @param {TYPO3.Components.PageTree.Tree} tree
         * @return {void}
         */
-       mountAsTreeRoot: function(node, tree) {
+       mountAsTreeRoot: function (node, tree) {
                TYPO3.Components.PageTree.Commands.setTemporaryMountPoint(
                        node.attributes.nodeData,
-                       function(response) {
+                       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() {
+                               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 {