JSon-Editor icon indicating copy to clipboard operation
JSon-Editor copied to clipboard

Cut and Paste nodes fails

Open cyoaleihq opened this issue 7 years ago • 0 comments

When cutting a node, the cut node remains in the object, causing a pasting of the node to give the error: "Can not add property to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object." After cutting a node, if the "Delete Node" option is used on the cut node (ie manually cutting it), followed by either "Paste After Node" or "Paste Before Node", the exception "ZTn.Json.JsonTreeView.Extensions.JTokenTreeNodeDeleteException: One or more errors occurred. ---> System.InvalidOperationException: The parent is missing." fires. The value pasted does end up in the correct spot though.

Steps to reproduce:

  1. File -> New -> New JSON Object
  2. Right click root -> JSON Object -> Insert Property As Value. Repeat this step 3 times. I find it helpful to rename one of these to something more obvious then their default names.
  3. Right click the middle node -> Edit -> Cut. Note that the value cut remains in the Object. 4a) Right click last node -> Edit -> Paste After Node. Note that an exception understandably fires. --or-- 4b) Right click middle node -> Edit -> Delete Node 5b) Right click last node -> Edit -> Paste After Node. Note that the node is correctly created in the right spot, but an exception is fired. Also of note, saving this document correctly outputs the expected .json file.

Version 1.5.0.38272. Windows 7 N 64bit

cyoaleihq avatar Apr 15 '17 02:04 cyoaleihq