Copied to clipboard

Flag this post as spam?

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


  • Daniel Rogers 118 posts 644 karma points
    Nov 29, 2022 @ 03:24
    Daniel Rogers
    0

    Creating a Property Editor Gives an erro

    Using Umbraco 10.3.2 and tring to follow this documentation https://our.umbraco.com/documentation/Tutorials/creating-a-property-editor/ and setup a custom property. It comes up in the common properties list to add however on adding it I get this error.

    Received an error from the server
    An error occurred
    Object reference not set to an instance of an object.
    
    Exception Details
    System.NullReferenceException, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: Object reference not set to an instance of an object.
    Stacktrace
    at Umbraco.Cms.Core.PropertyEditors.ConfigurationEditor`1.ToConfigurationEditor(TConfiguration configuration)
       at Umbraco.Cms.Core.Models.Mapping.DataTypeMapDefinition.MapPreValues(IDataEditor source, MapperContext context)
       at Umbraco.Cms.Core.Mapping.UmbracoMapper.<>c__DisplayClass9_0`2.<Define>b__0(Object source, MapperContext context)
       at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TTarget](Object source, Type sourceType, MapperContext context)
       at Umbraco.Cms.Core.Mapping.UmbracoMapper.Map[TSource,TTarget](TSource source, MapperContext context)
       at Umbraco.Cms.Web.BackOffice.Controllers.DataTypeController.GetPreValues(String editorAlias, Int32 dataTypeId)
       at lambda_method1858(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.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    

    Any suggestions

  • Daniel Rogers 118 posts 644 karma points
    Nov 30, 2022 @ 02:25
    Daniel Rogers
    100

    Solved Documentation a bit confusing.

    Assumed that first csharpe examples referred to use with v10 as the examples below expressly referred to v9.

    However that doesn't seem to be the case.

    Reinvorced by this statement

    "The snippets are slightly different in V9 because The snippets are slightly different in V9 because IEditorConfigurationParser isn't required.isn't required."

    However removing IEditorConfigurationParser solved the issue.

    So it seems that it also applies to version 10.

Please Sign in or register to post replies

Write your reply to:

Draft