[BUGFIX] Prohibit editing of uneditable labels in pagetree 80/53080/2
authorJohannes Goslar <jogo@kronberger-spiele.de>
Fri, 2 Jun 2017 20:15:16 +0000 (22:15 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 3 Jun 2017 12:45:26 +0000 (14:45 +0200)
Resolves: #81445
Releases: master, 8.7
Change-Id: Ie88eb7ce2fdaf7429377062e86996847f7e9bfa9
Reviewed-on: https://review.typo3.org/53080
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/tree.js

index e9bca25..53ee07f 100644 (file)
@@ -201,7 +201,7 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
                                        // This is a workaround to prevent TreeEditor being triggered, which also requires a patch within TreeEditor
                                        node.attributes.editable = false;
                                } else {
-                                       node.attributes.editable = true;
+                                       node.attributes.editable = node.attributes.editableDefault;
 
                                        if (!this.clicksRegistered && this.getSelectionModel().isSelected(node)) {
                                                node.fireEvent('click', node, event);
@@ -316,6 +316,10 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
                                        attr.id = 'siteRootNode';
                                }
 
+                               // nodes editable state needs to be forced to false at times
+                               // so we need to store the original value to revert back to
+                               attr.editableDefault = attr.editable;
+
                                return Ext.tree.TreeLoader.prototype.createNode.call(this, attr);
                        },