[BUGFIX] ModuleMenu::loadNavigationComponent must load custom tree 92/54892/2
authorSebastian Fischer <typo3@evoweb.de>
Mon, 13 Nov 2017 05:38:39 +0000 (06:38 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 12 Jan 2018 12:11:41 +0000 (13:11 +0100)
This patch changes initialization of the pagetree to make it possible
to open a custom module with its own navigation directly without the
need to open a Web/* module after opening the backend.

Resolves: #82982
Releases: 8.7
Change-Id: I9191d933ffd4e2169e80024f89b359a00bfde72e
Reviewed-on: https://review.typo3.org/54892
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Reiner Teubner <rteubner@me.com>
Tested-by: Reiner Teubner <rteubner@me.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Resources/Public/JavaScript/ModuleMenu.js

index 8efb1df..b88b0f1 100644 (file)
@@ -233,15 +233,18 @@ require(
                                }
                                // allow to render the pagetree hard-coded in order to have acceptance tests apply correctly
                                // and to ensure that something is loaded
-                               var component = Ext.getCmp(navigationComponentId);
+                               var component;
                                if (typeof this.availableNavigationComponents['typo3-pagetree'] === 'undefined') {
+                                       if ($('.t3js-scaffold-content-navigation [data-component="typo3-pagetree"]').length < 1) {
+                                               $('.t3js-scaffold-content-navigation')
+                                                       .append('<div class="scaffold-content-navigation-component" data-component="typo3-pagetree" id="navigationComponent-typo3-pagetree"></div>');
+                                       }
                                        component = new TYPO3.Components.PageTree.App();
-                                       component.render('navigationComponent-' + navigationComponentId);
+                                       component.render('navigationComponent-typo3-pagetree');
                                        this.availableNavigationComponents['typo3-pagetree'] = component;
-                                       // re-evaluate the component
-                                       component = Ext.getCmp(navigationComponentId);
                                }
 
+                               component = $('#' + navigationComponentId)[0];
                                if (typeof component === 'undefined') {
                                        var self = this,
                                                deferredComponentExists = $.Deferred();