Trouble setting up Umbraco Forms 7.2 fails with Template or Macro in RTE (InsertUmbracoForm.cshtml Line 16)
So I have been having a heck of a time getting Umbraco Forms working.
Currently Running:
Umbraco 7.15.3
Umbraco Forms v7.2
Initially, I could never get the trial working it sat dormant for quite a few upgrades which I think contributed to some problems. So I opted to purchase for the domain. Looking forward to getting it working, but I keep running into issues. One was the Partial View Macro InsertUmbracoForm was missing. I uninstalled, reinstalled with no luck. I manually created it. Though there are a few revisions floating around on various videos and forum posts, I believe I have the last known version. Then I had an issue with no Macro. I created the Macro manually but I was missing the correct FormGuid parameter. Anyway, eventually I was able to follow allow with the videos relating to the necessary script includes. Although I navigated these initial hurdles, I can't seem to get past this last stumbling block.
Whether I try to add the form to a Template, or embedded with a macro using the RTE, I get the same error:
Although no one has responded to this, I believe I solved the issue.
So having been through many, many upgrades of Umbraco over time, it seems that some of the web.config files in some of the sub-folders, such as on in ~/Views/Partials have been abandoned. Up until using forms their existence was trivial, and had no impact. But it would seem that because of their age they referenced namespaces that no longer exist, like Microsoft.Web and Helpers.
Removing any unnecessary web.config files cleared up the error, and now Forms functions.
So I'm not crazy. The training videos kept referring to using the macro, but it wasn't there.
What I did, was create a Macro called InsertUmbracoForm and then in the MVC Partial View filename field referenced the file that should have been there. I had the InsertUmbracoFormWithTheme but not InsertUmbracoForm
~/Views/MacroPartials/InsertUmbracoForm.cshtml
I checked off Use in RTE & the Grid, and Render in RTE & Grid.
Then from the source code, I "guessed" which parameters were needed based on what references I saw. The Alias & Name of: FormGuid, with a type of Form Picker
For me it was not, but I'll post the source below. There were multiple versions of this source I saw, one in the videos and several here in the forums. I picked what I suspect is the latest one.
InsertUmbracoForm.cshtml:
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@if (Model.MacroParameters["FormGuid"] != null)
{
var s = Model.MacroParameters["FormGuid"].ToString();
var g = new Guid(s);
var recordGuid = Guid.Empty;
if (string.IsNullOrEmpty(Request.QueryString["recordId"]) == false)
{
Guid.TryParse(Request.QueryString["recordId"], out recordGuid);
}
Html.RenderAction("Render", "UmbracoForms", new {formId = g, recordId = recordGuid, mode = "form"});
//Html.RenderAction("RenderForm", "UmbracoForms", new {formId = g, recordId = recordGuid, mode = "form"});
}
Trouble setting up Umbraco Forms 7.2 fails with Template or Macro in RTE (InsertUmbracoForm.cshtml Line 16)
So I have been having a heck of a time getting Umbraco Forms working.
Currently Running: Umbraco 7.15.3 Umbraco Forms v7.2
Initially, I could never get the trial working it sat dormant for quite a few upgrades which I think contributed to some problems. So I opted to purchase for the domain. Looking forward to getting it working, but I keep running into issues. One was the Partial View Macro InsertUmbracoForm was missing. I uninstalled, reinstalled with no luck. I manually created it. Though there are a few revisions floating around on various videos and forum posts, I believe I have the last known version. Then I had an issue with no Macro. I created the Macro manually but I was missing the correct FormGuid parameter. Anyway, eventually I was able to follow allow with the videos relating to the necessary script includes. Although I navigated these initial hurdles, I can't seem to get past this last stumbling block.
Whether I try to add the form to a Template, or embedded with a macro using the RTE, I get the same error:
Error loading Partial View script (file: ~/Views/MacroPartials/InsertUmbracoForm.cshtml)
My Log (below) File seems to imply a missing System.Web.Helpers, but it is there in the bin folder. Double checked that it's referenced in Web Config.
I'm at a bit of a loss.
Thanks, Jason
Although no one has responded to this, I believe I solved the issue.
So having been through many, many upgrades of Umbraco over time, it seems that some of the web.config files in some of the sub-folders, such as on in ~/Views/Partials have been abandoned. Up until using forms their existence was trivial, and had no impact. But it would seem that because of their age they referenced namespaces that no longer exist, like Microsoft.Web and Helpers.
Removing any unnecessary web.config files cleared up the error, and now Forms functions.
Hi Jason,
How did you add the missing macro? I just installed Umbraco forms as well and it's not showing in the Macros list.
Thanks, ~Andy
Hey Andy!
So I'm not crazy. The training videos kept referring to using the macro, but it wasn't there.
What I did, was create a Macro called InsertUmbracoForm and then in the MVC Partial View filename field referenced the file that should have been there. I had the InsertUmbracoFormWithTheme but not InsertUmbracoForm
~/Views/MacroPartials/InsertUmbracoForm.cshtml I checked off Use in RTE & the Grid, and Render in RTE & Grid.
Then from the source code, I "guessed" which parameters were needed based on what references I saw. The Alias & Name of: FormGuid, with a type of Form Picker
For me it was not, but I'll post the source below. There were multiple versions of this source I saw, one in the videos and several here in the forums. I picked what I suspect is the latest one.
InsertUmbracoForm.cshtml:
Hope this helps... Thanks, Jason
Perfect! Worked like a charm! Thanks, Jason! I can't believe they shipped a paid product half-baked like this!
is working on a reply...