You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When creating a content type in code and setting the AllowedContentTypes property of the ContentType object to null, uSync will throw an error when saving this content type.
System.ArgumentNullException: Value cannot be null. (Parameter 'source')
at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Linq.OrderedEnumerable`2..ctor(IEnumerable`1 source, Func`2 keySelector, IComparer`1 comparer, Boolean descending, OrderedEnumerable`1 parent)
at System.Linq.Enumerable.OrderBy[TSource,TKey](IEnumerable`1 source, Func`2 keySelector)
at uSync.Core.Serialization.Serializers.ContentTypeBaseSerializer`1.SerializeStructure(TObject item)
at uSync.Core.Serialization.Serializers.ContentTypeSerializer.SerializeCore(IContentType item, SyncSerializerOptions options)
at uSync.Core.Serialization.SyncSerializerRoot`1.Serialize(TObject item, SyncSerializerOptions options)
at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.SerializeItem(TObject item, SyncSerializerOptions options)
at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.Export_DoExport(TObject item, String filename, String[] folders, HandlerSettings config)
at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.Export(TObject item, String[] folders, HandlerSettings config)
at uSync.BackOffice.SyncHandlers.SyncHandlerRoot`2.Handle(SavedNotification`1 notification)
To Reproduce
Steps to reproduce the behavior:
Create these two document types in code. It doesn't matter where; in a razor view, in a controller or in a composition:
var result = new ContentType(stringHelper, -1)
{
Alias = "WorkingComposition",
Description = "This composition works",
Icon = "icon-home",
Name = "Working composition",
};
contentTypeService.Save(result);
var result2 = new ContentType(stringHelper, -1)
{
Alias = "NonWorkingComposition",
Description = "This composition doesn't work",
Icon = "icon-home color-red",
Name = "Not working composition",
AllowedContentTypes = null
};
contentTypeService.Save(result2);
When running this code, uSync will create the working composition file, but not the one where the AlloweedContentTypes are set to null:
Expected behavior
Because AllowedContentTypes is nullable I full expect it to be able to be set to null.
About your Site (please complete the following information):
Umbraco Version: 13.3.2
uSync Version: 13.2.3
The text was updated successfully, but these errors were encountered:
Describe the bug
When creating a content type in code and setting the AllowedContentTypes property of the ContentType object to null, uSync will throw an error when saving this content type.
To Reproduce
Steps to reproduce the behavior:
Create these two document types in code. It doesn't matter where; in a razor view, in a controller or in a composition:
When running this code, uSync will create the working composition file, but not the one where the AlloweedContentTypes are set to null:
Expected behavior
Because AllowedContentTypes is nullable I full expect it to be able to be set to null.
About your Site (please complete the following information):
The text was updated successfully, but these errors were encountered: