Forms V10: Cannot render custom fieldtype with custom theme
Hi, we upgraded to V10 recently. For some reason we can't seem to render a custom theme on our production environments. We had some problems with the Forms partials, so we removed them from the project. Now I have a custom theme in the Views/Partials/Forms/Themes folder. This is compiled in to the project now, so there are no razor files on the publish directory. When run from my local machine, I see the results I expected. But when run from azurewebsites, I get an exception that the custom fieldtype cannot be found (in the default theme folder).
System.InvalidOperationException: The partial view '/Views/Partials/Forms/Themes/default/Fieldtypes/FieldType.CourseName.cshtml' was not found. The following locations were searched:\r\n/Views/Partials/Forms/Themes/default/Fieldtypes/FieldType.CourseName.cshtml
I don't render the form from the partial, but in our form component we invoke the forms viewcomponent directly. (This is just what the macro does).
I also updated the custom theme to the latest template found here, but there are no differences with the V9 version aside from some null checks: https://our.umbraco.com/FileDownload?id=23911
I did make sure the removed additional files at destination flag is set to true. So old files, or cache, cannot be a problem.
Any idea why it will not render our custom theme on a production environment?
Don't think that is it :D. On my local machine it works fine, but for whatever reason it can't load the theme on my server and it will fall back to default
Can't confirm for sure, but I did have a similar issue with other things regardless of the Runtime mode, and everything worked fine only once I included the files to the project and added to the csproj file - could be just my setup or it could be something else - but maybe just try and see.
Decided to make a bug report on this. I don't think we are doing anything wrong at this time. Double checked the migration guide and did everything as described. So either the documentation is not complete, or it is an actual bug with forms.
Forms V10: Cannot render custom fieldtype with custom theme
Hi, we upgraded to V10 recently. For some reason we can't seem to render a custom theme on our production environments. We had some problems with the Forms partials, so we removed them from the project. Now I have a custom theme in the
Views/Partials/Forms/Themes
folder. This is compiled in to the project now, so there are no razor files on the publish directory. When run from my local machine, I see the results I expected. But when run from azurewebsites, I get an exception that the custom fieldtype cannot be found (in thedefault
theme folder).I don't render the form from the partial, but in our form component we invoke the forms viewcomponent directly. (This is just what the macro does).
I also updated the custom theme to the latest template found here, but there are no differences with the V9 version aside from some null checks: https://our.umbraco.com/FileDownload?id=23911
I did make sure the removed additional files at destination flag is set to true. So old files, or cache, cannot be a problem.
Any idea why it will not render our custom theme on a production environment?
Not sure if this will make a difference, but change includeScripts from true to 1
Don't think that is it :D. On my local machine it works fine, but for whatever reason it can't load the theme on my server and it will fall back to default
Have you included the files in your project before publishing?
Files are being compiled with the project because of the new production runtime mode. See: https://our.umbraco.com/documentation/Fundamentals/Setup/Server-Setup/runtime-modes
Can't confirm for sure, but I did have a similar issue with other things regardless of the Runtime mode, and everything worked fine only once I included the files to the project and added to the csproj file - could be just my setup or it could be something else - but maybe just try and see.
Decided to make a bug report on this. I don't think we are doing anything wrong at this time. Double checked the migration guide and did everything as described. So either the documentation is not complete, or it is an actual bug with forms.
https://github.com/umbraco/Umbraco.Forms.Issues/issues/877
Edit: A solution (and kind of a workaround) in the github issue. If you're having this issue that should solve it
is working on a reply...