Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gerhard Grossberger 55 posts 179 karma points
    Jun 18, 2021 @ 09:04
    Gerhard Grossberger
    0

    Can´t change varybyculture on an already created documenttype

    I have a documenttype where customer now found out they want to change one element to not varyByCulture. They already added loads of content, but while translating they found out this field should not varybyculture.

    When I now try to change the element in backend, I get a long exception

    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
       at Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.RenormalizeDocumentEditedFlags(IReadOnlyCollection`1 propertyTypeIds, IReadOnlyCollection`1 contentTypeIds) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepositoryBase.cs:line 1099
       at Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.MovePropertyTypeVariantData(IDictionary`2 propertyTypeChanges, IEnumerable`1 impacted) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepositoryBase.cs:line 685
       at Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepositoryBase`1.PersistUpdatedBaseContentType(IContentTypeComposition entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepositoryBase.cs:line 500
       at Umbraco.Core.Persistence.Repositories.Implement.ContentTypeRepository.PersistUpdatedItem(IContentType entity) in D:\a\1\s\src\Umbraco.Core\Persistence\Repositories\Implement\ContentTypeRepository.cs:line 290
       at ....
    

    which narrows down to:

    An item with the same key has already been added.

    How can I change this one element, without having to recreate all content for that element, which is quite a lot!

    I also tried to do that with uSync, also no success!

    Best, Gerhard

  • Gerhard Grossberger 55 posts 179 karma points
    Jun 21, 2021 @ 14:03
    Gerhard Grossberger
    1

    I ended up removing the content for that specific property for all languages expect my main language (EN) programmatically, then it worked easily.

Please Sign in or register to post replies

Write your reply to:

Draft