Copied to clipboard

Flag this post as spam?

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


  • Nick Hillman 17 posts 130 karma points
    Feb 22, 2022 @ 09:13
    Nick Hillman
    0

    MultiUrlPicker on 9.3

    Does anyone have a fix for this? A bug seems to have crept in between 9.2 and 9.3. The MultiUrlPicker no longer seems to work with a null value...

    @{
        var link = Model.Value<Link>("link");
        if (link != null)
        {
        <li><a href="@link.Url" target="@link.Target">@link.Name</a></li>
        }
    }
    

    I now get an error if I have an unset value

  • Damiaan 442 posts 1302 karma points MVP 6x c-trib
    Mar 21, 2022 @ 16:12
    Damiaan
    0

    Have you resolved your issue?

    If not, please provide some extra information.

    On which line does it fail? What does it say if you replace everything with @Model.Value("link") (it should print out the type of the object)

  • Nick Hillman 17 posts 130 karma points
    Mar 21, 2022 @ 16:30
    Nick Hillman
    0

    Hi Damiaan,

    Thanks for your reply... No I've not maganed to fix this yet.

    @Model.Value("Link"); returns the "Umbraco.Cms.Core.Models.Link " object. however if this is unset I get the following error...

    System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object. at Umbraco.Cms.Core.PropertyEditors.ValueConverters.MultiUrlPickerValueConverter.ConvertIntermediateToObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean preview) at Umbraco.Cms.Core.Models.PublishedContent.PublishedPropertyType.ConvertInterToObject(IPublishedElement owner, PropertyCacheLevel referenceCacheLevel, Object inter, Boolean preview) at Our.Umbraco.DocTypeGridEditor.Models.DetachedPublishedProperty.<.ctor>b_71() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at Umbraco.Extensions.PublishedElementExtensions.Value(IPublishedElement content, IPublishedValueFallback publishedValueFallback, String alias, String culture, String segment, Fallback fallback, Object defaultValue) at Umbraco.Extensions.FriendlyPublishedElementExtensions.Value(IPublishedElement content, String alias, String culture, String segment, Fallback fallback, Object defaultValue) at AspNetCore.Views_Partials_grid_editors_DocTypeGridEditor_imageSimple.ExecuteAsync() in C:\Users\Administrator\Desktop\Publish\PCClub 2022\Views\Partials\grid\editors\DocTypeGridEditor\imageSimple.cshtml:line 85 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult.ExecuteAsync(ViewComponentContext context) at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeAsync(ViewComponentContext context) at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentHelper.InvokeCoreAsync(ViewComponentDescriptor descriptor, Object arguments) --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Our.Umbraco.DocTypeGridEditor.Helpers.DocTypeGridEditorHelper.RenderDocTypeGridEditorItem(IViewComponentHelper helper, IHtmlHelper htmlHelper, IPublishedElement content, String editorAlias, String viewPath, String previewViewPath, Boolean isPreview) at Our.Umbraco.DocTypeGridEditor.Helpers.DocTypeGridEditorHelper.RenderDocTypeGridEditorItem(IViewComponentHelper helper, IHtmlHelper htmlHelper, Object model) at AspNetCore.apppluginsdoctypegrideditorrenderdoctypegrideditor.ExecuteAsync() in C:\Users\Administrator\Desktop\Publish\PCClub 2022\appplugins\doctypegrideditor\render\doctypegrideditor.cshtml:line 4 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.RenderPartialCoreAsync(String partialViewName, Object model, ViewDataDictionary viewData, TextWriter writer) at Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelper.PartialAsync(String partialViewName, Object model, ViewDataDictionary viewData) at AspNetCore.ViewsPartialsgrideditors_base.ExecuteAsync() in C:\Users\Administrator\Desktop\Publish\PCClub 2022\Views\Partials\grid\editors\base.cshtml:line 6

    when I check for a null entry or I get a similar error if I check for an empty string.

    This was working fine up to version 9.2, but stopped when i upgraded the project to 9.3

  • Katie 25 posts 90 karma points
    Apr 26, 2022 @ 14:34
    Katie
    0

    I have the same issue. Did you find a solution? Thank you Katie

  • David Walker 19 posts 90 karma points
    Aug 09, 2022 @ 13:27
    David Walker
    0

    I have the same issue at the moment.

    Seems to be when I import MultiUrlPickers via uSync into a new db, and although all seems well in Models, code, and page definitions - the field using the MutliUrlPicker is being handled like it doesn't exist.

    Once I save a link value to it - the object behaves normally, and I can remove the link, and the object still behaves normally.

    But not ideal when there are hundreds of pages to import.

    Anyone get to the bottom of this?

Please Sign in or register to post replies

Write your reply to:

Draft