Copied to clipboard

Flag this post as spam?

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


  • Kieron McIntyre 117 posts 360 karma points
    Dec 20, 2013 @ 22:04
    Kieron McIntyre
    0

    Getting "Please provide a valid form Id" with @Umbraco.RenderMacro

    This is all working locally, but on production the forms are not rendering and I am getting just the message "Please provide a valid form Id". I'm using 3.0.17.

    I have checked that the form id is correct, and also upper and lower case but nothing is working.

    All the code is identical across both sites and I have re uploaded everything about 3 times.

    @inherits UmbracoTemplatePage
    
    @{
    
         @Umbraco.RenderMacro("umbracoContour.RazorRenderForm",
             new{ FormGuid = SubscriptionForm.FormId })
    }
    

    I've tried replacing the form guid with the string version. I've even checkjed the database to ensure that the ids are correct and they are, albeit the database id is uppercase.

  • Kieron McIntyre 117 posts 360 karma points
    Dec 20, 2013 @ 22:42
    Kieron McIntyre
    0

    Right, if I try and add a form into a rich text editor, there are no forms to choose from. Also, I'm using Code First so the forms are all generated on application load, so they have to be constistent with my local version, right?

    Anyone, please?!

  • Kieron McIntyre 117 posts 360 karma points
    Dec 21, 2013 @ 18:43
    Kieron McIntyre
    101

    This turned out to be happening because at some point, installing Contour hadn't added the FormPicker record to the database's [cmsMacroPropertyType] table.

    However, I found this because the umbracoContour.RazorRenderForm macro didn't have the FormGuid parameter set. So, if you have this "Please provide a valid form Id" problem, check the parameter exists on the macro first and add it if it doesn't.

    If FormPicker doesn't exist on the list, check the database. You can find the insert script here: http://our.umbraco.org/projects/umbraco-pro/contour/documentation/installation/resources/createsqlserver

    I just ran the following part of the install script:

    INSERT INTO [cmsMacroPropertyType]
           ([macroPropertyTypeAlias]
           ,[macroPropertyTypeRenderAssembly]
           ,[macroPropertyTypeRenderType]
           ,[macroPropertyTypeBaseType])
    VALUES
           ('FormPicker'
           ,'Umbraco.Forms.UI'
           ,'MacroRenderings.FormPicker'
           ,'String')
    
Please Sign in or register to post replies

Write your reply to:

Draft