We are using Forms 6.0.3 and v1.8 of your package, when we attempt to render a form we get the following, any ideas, the file exists under the "default" theme folder but it seems it can't find it?
Any help appreciated! Great package so far, does exactly what we need if we can get it to display.
After testing a bit it seems this exception seems to be raised when rendering an Umbraco Form using code like this:
Html.RenderAction("Render", "UmbracoForms", new { formId = g });
It appears this is the "old" render action that was used before Forms added theme support. This action will look in the Views/Partials/Forms/Fieldtypes folder for the fieldtype .cshtml files.
However, ever since supporting themes, the "new" way to render forms seems to be a slightly different action:
Html.RenderAction("RenderForm", "UmbracoForms", new { formId = formId })
That is, you should call the "RenderForm" action rather than the "Form" action. I took this from the Macro Partial "InsertUmbracoFormWithTheme.cshtml".
Can you check that it works if you change this RenderAction call? And otherwise, you can simply copy our FieldTypes to the /Views/Partials/Forms/Fieldtypes folder, that should work as well.
Hi, yes we actually managed to figure it out but thanks for the reply, it works with the new call. It also works if you just dump the partials for all the field types in the /views/partials/fieldtypes/ but guessing that ignores themes.
On another note does the ability to pass a record guid via querystring still allow you to populate the fields? Believe it may have been removed from forms as part of a security update but would be handy for us?
Good to hear you had already solved the issue. I don't know anything about populating fields using the record id in the querystring, I guess you'll have to just test it and see if it still works :-) It is not something we would add with our package though, so if it has been removed you'll have to find another way. Good luck!
I've checked my log file and can see this message:
2017-12-29 11:23:14,999 [P4780/D5/T65] WARN umbraco.macro - Error loading Partial View (file: ~/Views/MacroPartials/InsertUmbracoFormWithTheme.cshtml). Exception: System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.InvalidOperationException: The partial view '/Views/Partials/Forms/Themes/default/FieldTypes/FieldType.Perplex Text field.cshtml' was not found or no view engine supports the searched locations. The following locations were searched:/Views/Partials/Forms/Themes/default/FieldTypes/FieldType.Perplex Text field.cshtml
I edited the filename of /Views/Partials/Forms/Themes/default/FieldTypes/FieldType.PerplexTextField.cshtml
to read 'FieldType.Perplex Text field.cshtml'
And the form shows fine. This seems like an odd way to fix the issue though.
Does anyone know why this file is being called like this? Where can I change it to request 'FieldType.PerplexTextField.cshtml' instead of 'FieldType.Perplex Text field.cshtml'
Are you using the latest version of our package? It assume you might have a version < 1.7, as at some point I added a line to our Field Types which explicitly states the view name. Otherwise, it would use the "friendly name" to find the view, in this case "Perplex Text field".
You should be able to simply update from within Umbraco (Developer > Packages > search for ours), or download the ZIP and choose "Install local". If you created any folders in the Forms section, make sure to backup App_Plugins/PerplexUmbracoForms/data/folders.json and put it back after. The forms themselves are stored by Umbraco, we do not touch them. Of course, test this first in a test environment :-)
Error when displaying form on page.
Hi,
We are using Forms 6.0.3 and v1.8 of your package, when we attempt to render a form we get the following, any ideas, the file exists under the "default" theme folder but it seems it can't find it?
Any help appreciated! Great package so far, does exactly what we need if we can get it to display.
Thanks
Tim
Hi Tim,
After testing a bit it seems this exception seems to be raised when rendering an Umbraco Form using code like this:
It appears this is the "old" render action that was used before Forms added theme support. This action will look in the Views/Partials/Forms/Fieldtypes folder for the fieldtype .cshtml files.
However, ever since supporting themes, the "new" way to render forms seems to be a slightly different action:
That is, you should call the "RenderForm" action rather than the "Form" action. I took this from the Macro Partial "InsertUmbracoFormWithTheme.cshtml".
Can you check that it works if you change this RenderAction call? And otherwise, you can simply copy our FieldTypes to the /Views/Partials/Forms/Fieldtypes folder, that should work as well.
Regards, Daniël
Hi, yes we actually managed to figure it out but thanks for the reply, it works with the new call. It also works if you just dump the partials for all the field types in the /views/partials/fieldtypes/ but guessing that ignores themes.
On another note does the ability to pass a record guid via querystring still allow you to populate the fields? Believe it may have been removed from forms as part of a security update but would be handy for us?
Thanks
Tim
Hey Tim,
Good to hear you had already solved the issue. I don't know anything about populating fields using the record id in the querystring, I guess you'll have to just test it and see if it still works :-) It is not something we would add with our package though, so if it has been removed you'll have to find another way. Good luck!
~ Daniël
Hi folks, I think my issue is related to this.
I've just manually upgraded Umbraco Forms to 6.0.5 (and I'm using Umbraco version 7.6.5 assembly: 1.0.6428.37121)
When using the 'Insert Form with theme' macro, i'm able to pick the form and theme.
But I receive this error message:
I've checked my log file and can see this message:
I edited the filename of
/Views/Partials/Forms/Themes/default/FieldTypes/FieldType.PerplexTextField.cshtml
to read
'FieldType.Perplex Text field.cshtml'
And the form shows fine. This seems like an odd way to fix the issue though.
Does anyone know why this file is being called like this? Where can I change it to request
'FieldType.PerplexTextField.cshtml'
instead of'FieldType.Perplex Text field.cshtml'
Hi Paul,
Are you using the latest version of our package? It assume you might have a version < 1.7, as at some point I added a line to our Field Types which explicitly states the view name. Otherwise, it would use the "friendly name" to find the view, in this case "Perplex Text field".
For example, in PerplexTextField.cs, I added this:
That would result in "FieldType.PerplexTextField.cshtml". So upgrading our package would probably resolve your issue.
~ Daniël
Daniël, thanks so much. You're right I only have version 1.6.
Rookie questions, but what's the best way to upgrade? Can I simply remove and reinstall the package without affecting my built forms?
I don't have access to nuget right now unfortunately, if that was going to be the best answer.
Kind regards, Paul
Hi Paul,
You should be able to simply update from within Umbraco (Developer > Packages > search for ours), or download the ZIP and choose "Install local". If you created any folders in the Forms section, make sure to backup App_Plugins/PerplexUmbracoForms/data/folders.json and put it back after. The forms themselves are stored by Umbraco, we do not touch them. Of course, test this first in a test environment :-)
Thanks so much Daniel, that worked :)
All the very best, Paul
is working on a reply...