GithubHelp home page GithubHelp logo

Comments (2)

cassidydotdk avatar cassidydotdk commented on July 20, 2024

Hmm not entirely sure I follow the scenario.

Not sure if this is possible, but would be good if unicorn could update the path and name of the item in the same time.

Path and name are interlocked; where "name" is just the tail end of the "path".

I'm guessing that it's probably because unicorn tries to move the item first and then update it's name and this will not work as there is already an item with such name in the second path.

Unicorn doesn't "move the item" at all. Sitecore does. Unicorn just reflects what's in Sitecore. Do you have the full stack trace of that DuplicateItemName exception?

To fix that error we can manually update name of the first item to something else, and then unicorn sync works.

Unicorn Sync is the process of taking what's on disk (yaml files) and updating the Sitecore content tree to reflect. When moving an item from one Unicorn configuration scope to another Unicorn configuration scope, you would need to perform a full reserialize of both configurations involved.

I would need some additional information to do anything with this. But generally speaking, if you move a Sitecore item with name "ItemA" to another part of the Sitecore content tree that already has an item named "ItemA" - you would run into an exception on certain Sitecore versions. And Unicorn plays no part in this.

from unicorn.

bartlomiejmucha avatar bartlomiejmucha commented on July 20, 2024

Here is the error from the logs. It's from my local tests. As you can see it can't move _Donation2 item because 'The item name "_Donation" is already defined on this level.'

We have the items
master:/sitecore/templates/Feature/Form/_Donation
master:/sitecore/templates/Foundation/Form/_Donation

and my colleague renamed the first one to Donation Base and moved to Foundation and he serialized changes to the repo. So in repo and in his database we have two items:

master:/sitecore/templates/Foundation/Form/_Donation Base (previously: master:/sitecore/templates/Feature/Form/_Donation)
master:/sitecore/templates/Foundation/Form/_Donation

I pulled that change and I got such an error. I feel that I got that error because in my database I still have the first item under old name: (master:/sitecore/templates/Feature/Form/_Donation).
To fix that issue I renamed that item to something else, and then sync went fine.

Not sure if this is a unicorn or Sitecore error. Or is it error at all, maybe it's a feature ;)

44940 15:31:35 ERROR ERROR: Some directories could not be loaded. (1 inner failures)
master:/sitecore/templates/Foundation/Form/_Donation2 (c247134c-aa4c-4e52-8af8-785310e8d1f5) (Unicorn.DeserializationAggregateException)
at Unicorn.Loader.DeserializeFailureRetryer.RetryAll(ISourceDataStore sourceDataStore, Action`1 retrySingleItemAction, Action`1 retryTreeAction)
at Unicorn.Loader.SerializationLoader.LoadAll(IItemData[] rootItemsData, IDeserializeFailureRetryer retryer, IConsistencyChecker consistencyChecker, Action`1 rootLoadedCallback)
at Unicorn.SerializationHelper.SyncTree(IConfiguration configuration, Action`1 rootLoadedCallback, Boolean runSyncStartPipeline, IItemData partialSyncRoot)
at Unicorn.SerializationHelper.SyncConfigurations(IConfiguration[] configurations, IProgressStatus progress, ILogger additionalLogger)

INNER EXCEPTION
master:/sitecore/templates/Foundation/Form/_Donation2 (c247134c-aa4c-4e52-8af8-785310e8d1f5) (Rainbow.Storage.Sc.Deserialization.DeserializationException)
No stack trace available.
INNER EXCEPTION
The item name "_Donation" is already defined on this level. (Sitecore.Exceptions.DuplicateItemNameException)
at Sitecore.Data.Items.ItemUtil.AssertDuplicateItemName(Item destinationItem, Item sourceItem, String name)
at Sitecore.Data.Items.Item.MoveTo(Item destination)
at Rainbow.Storage.Sc.Deserialization.DefaultDeserializer.GetOrCreateTargetItem(IItemData serializedItemData, Boolean& newItemWasCreated)
at Rainbow.Storage.Sc.Deserialization.DefaultDeserializer.Deserialize(IItemData serializedItemData, IFieldValueManipulator fieldValueManipulator)
at Rainbow.Storage.Sc.SitecoreDataStore.Save(IItemData item, IFieldValueManipulator fieldValueManipulator)
at Unicorn.Evaluators.SerializedAsMasterEvaluator.EvaluateUpdate(IItemData sourceItem, IItemData targetItem)
at Unicorn.Loader.SerializationLoader.DoLoadItem(IItemData serializedItemData, IConsistencyChecker consistencyChecker)
at Unicorn.Loader.DeserializeFailureRetryer.RetryAll(ISourceDataStore sourceDataStore, Action`1 retrySingleItemAction, Action`1 retryTreeAction)

from unicorn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.