We faced the following issue with Unicorn serialisation and I wanted to share it just in case someone has a better solution/workaround to it.
We are using Unicorn 2.0.4 on a project where we cannot (at least by now) upgrade to Unicorn 3.
When an item is renamed on Sitecore, unicorn doesn't detect it and *.item files remain on disk with their original names and content with the following attributes:
- path: Pointing to the original path which is wrong
- parent: Pointing to their parent Id which is right as the id didn't change in the rename.
Moreover, if the renamed item has children then the *.item files representing those children are not updated either. They are kept in a folder with the old name and with their "path" attribute pointing to the wrong path.
If the developer has several *.item files with changes to be comited it is easy commit them without realising about the issue in which case the changes are lost.
Things can get even worse if additional changes are done to the renamed item (or its children) then Unicorn create new *.item files only for those items that are updated. If there are other descendant not being updated then their associated *.item file is not created. This scenario makes more difficult to detect the missing items and more time consuming to fix it.
Once the issue is detected then we need to make sure all items in a subtree are serialised. The only way (I know) to do it is by manually modifying all descendants, one by one, which implied:
- Edit any field
- Save the item
- Restore the field to its original value
- Save the item again
Once all items have been serialised, we have to delete the old *.item to avoid duplications when reverting serialised items.
My main questions are:
- Does anyone know a way to make Unicorn detect item re-naming?
- Is there an easy way (without changing serialisation configuration) to make Unicorn serialise an item with its children?
Additional questions are:
- Does Unicorn 3 handle this scenario better?
- Does TDS have this issue?