Copied to clipboard

Flag this post as spam?

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


  • Kevin 5 posts 85 karma points
    Oct 13, 2022 @ 11:32
    Kevin
    0

    Issue with Umbraco Forms after upgrade of site to V10.2.1

    I recently upgraded an Umbraco site that is in a prolonged development process from V9 to V10.

    The upgrade process was causing issues with Umbraco forms so I removed this, with a view to reinstalling after I upgraded the main site.

    After successfully upgrading the main site I have reinstalled Forms however now I have an issue.

    I can successfully create forms, however I cannot insert these into the page.

    I seem to have duplicate Form Pickers and Form Theme Pickers which I think is causing an issue when we insert the form using the rich text editor.

    Please see attached errors.

    The Umbraco CMS package version is 10.2.1

    The Umbraco Forms version is 10.1.2

    Can anyone assist me with this issue please?

    Issue when inserting form

    Duplicated Editors

  • Ben Stephenson 4 posts 116 karma points
    Oct 17, 2022 @ 10:40
    Ben Stephenson
    101

    Hi Kevin,

    I've just come across this issue when upgrading one of our sites from 9 to 10. Though I didn't immediately trigger that it was part of Forms until seeing this post, I was just getting "Sequence contains more than one matching element".

    I have got the Umbraco to only show 1 set of Property Editors by deleting the UmbracoForms folder from the App_Plugins folder. "Forms Theme Picker" appears to be the Umbraco 9 Version. What I think is happening is that Forms has changed how it gets loaded into Umbraco but because the old files aren't removed (either being part of the project, or NuGet not removing as part of the upgrade), the Editors were being added in twice.

    Umbraco 9 Property Editors Umbraco 9 Property Editors

    Umbraco 10 with AppPlugins Files still in Solution Umbraco 10 with App</em>Plugins Files still in Solution

    Umbraco 10 without AppPlugins Files Umbraco 10 without App</em>Plugins Files

    I hope this helps, if you are still getting the issue.

    Kind Regards, Ben

  • Kevin 5 posts 85 karma points
    Oct 17, 2022 @ 13:33
    Kevin
    0

    Hi Ben,

    That's awesome!

    That has got rid of the duplicate pickers issue for me. Thanks for taking the time to post this. Deleting that folder did the trick!

    Unfortunately I'm now getting a different issue as follows when I try to insert a form into the rich text editor:

    An error occurred The given key 'FormGuid' was not present in the dictionary.

    Exception Details System.Collections.Generic.KeyNotFoundException, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: The given key 'FormGuid' was not present in the dictionary.

    screenshot

    The macro used to insert the form in the Rich Text Editor points to InsertUmbracoFormWithTheme.cshtml

    I have added FormGuid and FormTheme parameters using the Form Picker and Form Theme Picker data types but I'm still getting this error.

    Currently looking into it, but just wondering if you or anyone had also experienced this?

    Thanks,

    Kevin

  • Ben Stephenson 4 posts 116 karma points
    Oct 17, 2022 @ 19:45
    Ben Stephenson
    1

    Hi Kevin,

    Great to hear the deleting the folder has sorted the Sequence error.

    Unfortunately, I don't know off the top of my head what's happening with the error you are seeing now. We don't use Macro's in our builds.

    Looking at the error you're getting and the code for the Macro, the first thing it should be doing is checking if the FormGuid is present in the MacroParameters before even trying to Invoke the RenderForm method.

    @inherits Umbraco.Cms.Web.Common.Macros.PartialViewMacroPage
    
    @if (Model.MacroParameters["FormGuid"] != null)
    {
        var s = Model.MacroParameters["FormGuid"].ToString();
        var theme = "";
        var includeScripts = true;
        ....
    

    Have you changed this view in any way?

    Kind Regards,

    Ben

  • Kevin 5 posts 85 karma points
    Oct 21, 2022 @ 08:48
    Kevin
    0

    Hi Ben,

    Thanks again for your reply.

    This physical file was not present in the latest Forms installation, so I decided to create it to test the parameters.

    After some tests - ["formGuid"] with the lower case 'f' did work to retrieve the GUID value in the macro, however with the uppercase 'F', it did not work.

    So, it's working for the time being, when I get time I will look into the root cause.

    Thanks again for the pointers on this. I will mark your initial answer as the solution to my original issue.

    Cheers,

    Kevin

Please Sign in or register to post replies

Write your reply to:

Draft