Copied to clipboard

Flag this post as spam?

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


  • Jaymin Darji 1 post 71 karma points
    Jul 19, 2022 @ 13:06
    Jaymin Darji
    0

    throws an error while adding a property in a document type.

    Initially, the whole project was built using "InMemoryAuto" modelBuilder. Then the modelBuilder was changed to "SourceCodeAuto". I have also used uSync. I have changed the related files as well. enter image description here

    Here is a stack trace :at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException() at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable1 source, Func`2 predicate, Boolean& found) at Umbraco.Cms.Web.BackOffice.Controllers.DataTypeController.GetGroupedDataTypes() at lambdamethod1237(Closure , Object , Object[] ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Awaited|260(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

    `

  • Alex Solek 5 posts 78 karma points
    Mar 07, 2023 @ 15:51
    Alex Solek
    3

    Hi Jaymin,

    I realize this is quite an old post but thought I'd share my solution to this kind of problem in case anyone else comes across this.

    I encountered this error in the following scenario:

    1. We have built our own internal starter kit which was packaged up into a NuGet package. This also depends on a sub-project (another internal NuGet package)
    2. We used the Conditional Displayers package for some of our document types
    3. Upon installing the starter kit NuGet package on a fresh installation this error would appear on certain document types, especially when searching for a property editor in the add property window of a document type.

    To troubleshoot this we used the following snippet of code to essentially log all property editors and data types. Using this we were able to tell which property type is causing the issue.

    @using Umbraco.Cms.Core.PropertyEditors
    @using Umbraco.Cms.Core.Services
    @using Umbraco.Cms.Core.Mapping
    @using System.Data
    @using System.Linq
    @using Umbraco.Cms.Core.Models
    @using Umbraco.Cms.Core.Models.ContentEditing
    @using System
    
    @inject IDataTypeService DataTypeService
    @inject PropertyEditorCollection propertyEditors
    @inject IUmbracoMapper umbracoMapper
    
    @{
        var propertyEditorsList = propertyEditors.ToArray();
        var dataTypeList = DataTypeService.GetAll().Select(umbracoMapper.Map<IDataType, DataTypeBasic>)
                         .ToArray();
    
        foreach(var dataType  in dataTypeList) {
            Console.WriteLine("About to process: " + dataType.Name);
    
            var propertyEditor = propertyEditorsList.SingleOrDefault(x => x.Alias == dataType?.Alias);
    
            Console.WriteLine("Processed: " + propertyEditor.Name);
        }
    }
    

    Parts of this have been extracted from the GetGrouppedDataTypes() method from https://github.com/umbraco/Umbraco-CMS/blob/d61dfdcf22160fd8d4be62190e6d992be9a26acd/src/Umbraco.Web.BackOffice/Controllers/DataTypeController.cs

    Running this should break the application and your terminal should show the datatype name prefixed with "About to process:" followed by the error. This will give you an indication of which data type is failing to process.

    In our case, it was any data type to do with Conditional Displayers and we had to remove the dependency for this package from our sub-project and recompile the whole starter kit package to resolve this issue.

    Hope this becomes useful to someone.

  • roger malik 16 posts 78 karma points
    Mar 12, 2024 @ 16:38
    roger malik
    0

    You can also get this error when selecting a plugin with the same alias in the package.manifest file.

Please Sign in or register to post replies

Write your reply to:

Draft