0012286: container node permissions action missing from ctx menu after rename
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 31 Oct 2016 11:29:40 +0000 (12:29 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 31 Oct 2016 11:35:14 +0000 (12:35 +0100)
* name property could be an object

https://forge.tine20.org/view.php?id=12286

Change-Id: I4431f01c82a3c8229c75aea7441f74afd32d15da
Reviewed-on: http://gerrit.tine20.com/customers/3707
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Filemanager/js/NodeTreePanel.js

index 6774f17..b101996 100644 (file)
@@ -720,18 +720,17 @@ Ext.extend(Tine.Filemanager.NodeTreePanel, Tine.widgets.container.TreePanel, {
         };
         
         node.attributes.nodeRecord.beginEdit();
-        node.attributes.nodeRecord.set('name', newName);
-        node.attributes.nodeRecord.set('path', nodeData.path);
-        node.attributes.path = nodeData.path;
-        node.attributes.nodeRecord.commit(false);
-        
-        if(typeof node.attributes.name == 'object') {
+        if (typeof node.attributes.name == 'object') {
             node.attributes.name.name = newName;
-        }
-        else {
+            node.attributes.nodeRecord.data.name.name = newName;
+        else {
             node.attributes.name = newName;
+            node.attributes.nodeRecord.set('name', newName);
         }
-        
+        node.attributes.path = nodeData.path;
+        node.attributes.nodeRecord.set('path', nodeData.path);
+        node.attributes.nodeRecord.commit(false);
+
         grid.currenFolderNode = node;
         
         Tine.Filemanager.NodeTreePanel.superclass.onSelectionChange.call(this, this.getSelectionModel(), node);