Copied to clipboard

Flag this post as spam?

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


  • Ed Parry 64 posts 250 karma points c-trib
    Jun 15, 2016 @ 15:46
    Ed Parry
    0

    Unable to render Contour form after upgrade

    We're using Contour v3.0.29 and Umbraco v7.3.6 that was recently upgraded. Forms currently on the website are continuing to work as expected, but any attempts to add a new form to a page using the umbracoContourRazorRenderForm macro generates an error along the lines of:

    Value cannot be null.
    Parameter name: child
    
    On line: @CurrentPage.GetProperty("content")
    

    The top part of the stack trace is:

    Parameter name: child]
       System.Web.UI.ControlCollection.Add(Control child) +11815491
       Umbraco.Web.UmbracoComponentRenderer.RenderMacro(macro m, IDictionary`2 parameters, page umbracoPage) +571
       Umbraco.Web.PropertyEditors.ValueConverters.<>c__DisplayClass0_1.<RenderRteMacros>b__1(String macroAlias, Dictionary`2 macroAttributes) +305
       Umbraco.Core.Macros.MacroTagParser.ParseMacros(String text, Action`1 textFoundCallback, Action`2 macroFoundCallback) +835
       Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.RenderRteMacros(String source, Boolean preview) +383
       Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview) +119
       Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.<.ctor>b__15_0() +51
       System.Lazy`1.CreateValue() +709
       System.Lazy`1.LazyInitValue() +191
       Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.<.ctor>b__15_1() +24
    

    Is this a known issue?

  • Dennis Aaen 4434 posts 17891 karma points admin hq c-trib
    Jun 16, 2016 @ 08:44
    Dennis Aaen
    0

    Hi Ed,

    To things to check up on here.

    First this is try to to the developer section and into the macros folder. Click on the macro for the mbracoContourRazorRenderForm, be sure that it loads a partial view, like the screenshot below.

    enter image description here

    The order thing, to check is that the parameter also have been added.

    enter image description here

    Hope this helps and make sense for you although that the name of the file and parameter can be a bit different. CanĀ“t remember if this has been changed, in Umbraco Forms, where my screenshots are from :-)

    /Dennis

  • Ed Parry 64 posts 250 karma points c-trib
    Jun 16, 2016 @ 08:53
    Ed Parry
    0

    Hi Dennis,

    Thanks for the response!

    I currently have a macro available but it is using a razor script from the /macroScripts folder. I don't have a Contour MacroPartial View file - would you happen to have an example of how this should look to be included? Using the file in the /macroScripts folder is what is generating the error.

    Thanks! Ed

  • Ed Parry 64 posts 250 karma points c-trib
    Jun 16, 2016 @ 09:08
    Ed Parry
    0

    Hi Dennis,

    I've found the MacroPartial file that you mentioned to try it, but that also generates another error about there being no route in the route table for Html.RenderAction("Render", "UmbracoForms", new {formId = g, recordId = recordGuid });

    I think we're almost half way between Contour and Umbraco Forms here, so not everything is in place for Forms?

  • Ed Parry 64 posts 250 karma points c-trib
    Jun 20, 2016 @ 07:58
    Ed Parry
    0

    Pinging this back into view in case anyone else has any ideas on this one?

  • Dennis Aaen 4434 posts 17891 karma points admin hq c-trib
    Jun 21, 2016 @ 17:22
    Dennis Aaen
    0

    Hi Ed,

    Sorry for the little late answer but there have been Codegarden in Odense last week.

    Things to check is that your macro is linking to a razor file, and have the macro parameter as well like the screenshots below.

    enter image description here

    enter image description here

    Hope this helps,

    /Dennis

  • Ed Parry 64 posts 250 karma points c-trib
    Jun 23, 2016 @ 15:43
    Ed Parry
    0

    Hi Dennis,

    No problem - hope you enjoyed CodeGarden!

    All of that looks to be in place and didn't really change since before the upgrade. Though it might be useful to see what's in your MvcRenderContourForm.cshtml file in case there is something out of line? Otherwise it is more difficult to pinpoint the issue here.

  • Dennis Aaen 4434 posts 17891 karma points admin hq c-trib
    Jun 23, 2016 @ 17:37
    Dennis Aaen
    0

    Hi Ed,

    The content of my file is as following:

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using Umbraco.Forms.Mvc.Bridge.Html;
    @{
        string action = "ContourForm";
        string controller = "FormRender";
        string formtoken = "UmbracoContourForm";
        string formGuid = Parameter.FormGuid;
    
        @Html.RenderMvcAction(action, controller, formGuid, formtoken, (umbraco.MacroEngines.DynamicNode)Model, (System.Dynamic.DynamicObject)Parameter);
    }
    

    Best,

    /Dennis

  • Warren Buckley 2085 posts 4522 karma points MVP 6x admin hq c-trib
    Jul 08, 2016 @ 10:54
    Warren Buckley
    0

    Hello Ed,
    I am just reading through this chain.

    Are you trying to upgrade from Contour to Umbraco Forms is my understanding?

    If so then this may help you moving parts across successfully - https://our.umbraco.org/projects/developer-tools/umbraco-forms-migration/

    Thanks,
    Warren

  • Ed Parry 64 posts 250 karma points c-trib
    Jul 08, 2016 @ 11:27
    Ed Parry
    100

    Hi Warren,

    Thanks for picking this up.

    The issue was actually around an Umbraco upgrade, from 7.1.8 using Contour, up to 7.3.6. We didn't upgrade Contour as part of this, and existing forms continued to work but creating new forms or adding the macro to a page caused an error.

    We have discovered that the issue must have been the file formatting of the MvcRenderContourForm.cshtml file, as a simple copy/paste of this back into the macroScripts folder resolved the issue, suggesting that nothing was actually out of line within the system!

    We may be upgrading to Forms shortly though, so thanks for the pointer towards help for that! :)

    Ed

Please Sign in or register to post replies

Write your reply to:

Draft