Where will Sitecore restore an item from the recycle bin whose Original Location is [orphan]/Item Name
?
1 Answer
If you restore an item from the recycle bin that has one or more ancestor items that have been deleted, Sitecore will recreate the ancestor items as well, but they will be items without a version.
For example, let's say we have a content tree like this one with three nested items (Parent
- Child
- Sub-Child
):
I delete the Sub-Child
item first, and then the Parent
item. The two items will be listed in the Recycled Bin as follow:
Now I restore the Sub-Child
item only. The content tree will have the same initial nested structure, but the created Parent
item and the Child
item will not have a version:
Answer to the follow up question "What happens if there is no path and it only says [orphan]/Sub-Child?":
I am not sure how you got an archived item with the path [Orphan]/Item Name
in the Recycle Bin.
The path of the recycled items is stored in the OriginalLocation
field of the records in the Archive
table of the master database. I manually changed the path of one of my recycled items to be '[Orphan]/Item Name` to mimic your scenario.
When I tried to restore it, I got an error message saying that the item could not be restored. So it seems that Sitecore prevents the restoring of an archived item that has an invalid path.
Error in the logs:
ERROR Restore: failed to restore: archiveId 2471b9c5-1241-4043-a450-96110e5b44c5, error: Empty strings are not allowed.
Parameter name: path
-
1I want to add a few additional things in the original answer, @Alessandro's answer is correct with N level if the parent item is in the recycle bin if the parent item is deleted from the recycle bin then it will work in same way with 2 levels but the template type will be a common folder and parent item ID will be different from the original parent item, mean it will create a folder without version and a new ID. Since this is an exceptional case but if the hierarchy is more then 2 level then you may see some weird behavior if parent items are deleted from the recycle bin. Commented Feb 21, 2020 at 7:58
-
In your example, however, the item in the Recycle Bin still has a path. What happens if there is no path and it only says
[orpan]/Sub-Child
? Commented Feb 21, 2020 at 11:59 -
@DanSinclair: I edited my answer to answer your follow up question. Commented Feb 21, 2020 at 13:57