Adding mandatory validation to field - form disappears from backoffice
Hello All,
I had just finished getting an Umbraco form to work the way I want it. So I proceeded to make fields mandatory, part of the way through I clicked saved. In red I started to received the following
Unable to get Form with ID: 'cc224816-b2f9-4e43-8b1c-d7b16f0b1465' off disk or from the cache. Check the file exists on disk
Form then disappeared from the back-office.....
Looking at the tracelog, I get this:
Error loading Partial View (file: ~/Views/MacroPartials/InsertUmbracoForm.cshtml). Exception: System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.NullReferenceException: Unable to get Form with ID: 'cc224816-b2f9-4e43-8b1c-d7b16f0b1465' off disk or from the cache. Check the file exists on disk
at Umbraco.Forms.Data.Storage.FormStorage.GetForm(Guid id)
at Umbraco.Forms.Web.Controllers.UmbracoFormsController.GetForm(Guid formId)
at Umbraco.Forms.Web.Controllers.UmbracoFormsController.Render(Guid formId, Nullable`1 recordId, String view, String mode)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3()
at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter)
at System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, Object routeValues)
at ASP._Page_Views_MacroPartials_InsertUmbracoForm_cshtml.Execute() in c:\development\VinaCapital\VinaCapital\Views\MacroPartials\InsertUmbracoForm.cshtml:line 17
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
at Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult)
at Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content)
at umbraco.macro.LoadPartialViewMacro(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
Do you work locally or on a test server or live server?
Have you checked that the form in fact exists on the disk by having a look in the /App_Plugins/UmbracoForms/Data/forms folder where the forms are located?
When I was using Form 4.4.0-4.4.2 I had a similar issue as well as many other people. Where updating a form had a chance to remove the JSON file. This was due to the file having no safeguard during the delete then save during the update process.
Adding mandatory validation to field - form disappears from backoffice
Hello All,
I had just finished getting an Umbraco form to work the way I want it. So I proceeded to make fields mandatory, part of the way through I clicked saved. In red I started to received the following
Form then disappeared from the back-office.....
Looking at the tracelog, I get this:
Hi John
Do you work locally or on a test server or live server?
Have you checked that the form in fact exists on the disk by having a look in the /App_Plugins/UmbracoForms/Data/forms folder where the forms are located?
Looking forward to hearing from you.
/Jan
Hi Jan,
The form was in the back-office then it just disappeared.
The json file that was there, and then disappeared too, hence I assume it disappeared from back-office.
I'll do some more digging around in the logs.
I managed to recreate the form again (second time around much faster :-) )
Cheers John
What version of umbraco and forms are you on?
When I was using Form 4.4.0-4.4.2 I had a similar issue as well as many other people. Where updating a form had a chance to remove the JSON file. This was due to the file having no safeguard during the delete then save during the update process.
It was fixed in 4.4.3 http://issues.umbraco.org/issue/CON-1231
is working on a reply...