November Happy Hour will be moved to Thursday December 5th.

Form crashes if created under page (For this page)

Vote:
 

We are having problems in production with one of our forms after updating Episerver Forms to 4.29.1.

The form is unlike our other forms created under a page (For this page) and the block (Paragraph block) used on the form is also created under the page, not under the form.

See stacktrace:

System.Web.HttpException (0x80004005): 
  Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. ---> System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerWrapper'. ---> System.Web.HttpUnhandledException (0x80004005): 
    Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> 
      System.NullReferenceException: Object reference not set to an instance of an object. at EPiServer.Forms.Helpers.Internal.FormsExtensions.GetFormBlock(FormIdentity formIden) at EPiServer.Forms.Core.Internal.PlaceHolderService.GetFormElementsPlaceHolders(FormIdentity formIden) at EPiServer.Forms.Implementation.Elements.ParagraphTextElementBlock.HasPlaceHolder() at ASP.episerver_episerver_forms_views_elementblocks_paragraphtextelementblock_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.Mvc.ViewPage.RenderView(ViewContext viewContext) at System.Web.Mvc.ViewUserControl.RenderViewAndRestoreContentType(ViewPage containerPage, ViewContext viewContext) at System.Web.Mvc.ViewUserControl.RenderView(ViewContext viewContext) at EPiServer.Web.Mvc.ViewExtensions.Render[T](IView view, ViewEngineResult viewEngineResult, ViewContext context, TextWriter writer, T data) at EPiServer.Web.Mvc.Internal.DefaultMvcContentRenderer.HandleRenderTemplateWithViewEngine(HtmlHelper helper, IContentData contentData, TemplateModel templateModel) at EPiServer.Web.Mvc.Internal.DefaultMvcContentRenderer.Render(HtmlHelper helper, PartialRequest partialRequestHandler, IContentData contentData, TemplateModel templateModel) at EPiServer.Web.Mvc.Html.IContentDataExtensions.RenderContentData(HtmlHelper html, IContentData contentData, Boolean isContentInContentArea, TemplateModel templateModel, IContentRenderer contentRenderer, Func`1 partialRequest) at EPiServer.Web.Mvc.Html.IContentDataExtensions.RenderContentData(HtmlHelper html, IContentData contentData, Boolean isContentInContentArea, TemplateModel templateModel, IContentRenderer contentRenderer) at EPiServer.Web.Mvc.Html.IContentDataExtensions.RenderContentData(HtmlHelper html, IContentData contentData, Boolean isContentInContentArea, String templateTag) at EPiServer.Web.Mvc.Html.IContentDataExtensions.RenderContentData(HtmlHelper html, IContentData contentData, Boolean isContentInContentArea) at Apoteket.Core.EPi.Extensions.FormsHtmlHelperExtensions.RenderFormElements(HtmlHelper html, Int32 currentStepIndex, IEnumerable`1 elements, FormContainerBlock model) in D:\TeamCity\BuildAgent\work\faa4e25bfd84e34e\Src\Apoteket.Core\EPi\Extensions\FormsHtmlHelperExtensions.cs:line 50 at ASP.views_shared_elementblocks_formcontainerblock_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass5_0.<Wrap>b__0() 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.ViewPage.RenderView(ViewContext viewContext) at System.Web.Mvc.ViewUserControl.RenderViewAndRestoreContentType(ViewPage containerPage, ViewContext viewContext) at System.Web.Mvc.ViewUserControl.RenderView(ViewContext viewContext) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__5(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c.<BeginExecuteCore>b__152_1(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.<>c.<BeginProcessRequest>b__20_1(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__DisplayClass5_0.<Wrap>b__0() 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 EPiServer.Web.Mvc.PartialRequest.RenderAction(HtmlHelper helper, String action, String controller, Object routeValues) at EPiServer.Web.Mvc.Html.IContentDataExtensions.RenderContentData(HtmlHelper html, IContentData contentData, Boolean isContentInContentArea, TemplateModel templateModel, IContentRenderer contentRenderer, Func`1 partialRequest) at EPiServer.Web.Mvc.Html.ContentAreaRenderer.RenderContentAreaItem(HtmlHelper htmlHelper, ContentAreaItem contentAreaItem, String templateTag, String htmlTag, String cssClass) at EPiServer.Web.Mvc.Html.ContentAreaRenderer.RenderContentAreaItems(HtmlHelper htmlHelper, IEnumerable`1 contentAreaItems) at EPiServer.Web.Mvc.Html.ContentAreaRenderer.Render(HtmlHelper htmlHelper, ContentArea contentArea) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass5_0.<Wrap>b__0() 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.ViewPage.RenderView(ViewContext viewContext) at System.Web.Mvc.ViewUserControl.RenderViewAndRestoreContentType(ViewPage containerPage, ViewContext viewContext) at System.Web.Mvc.ViewUserControl.RenderView(ViewContext viewContext) at System.Web.Mvc.Html.TemplateHelpers.ExecuteTemplate(HtmlHelper html, ViewDataDictionary viewData, String templateName, DataBoundControlMode mode, GetViewNamesDelegate getViewNames, GetDefaultActionsDelegate getDefaultActions) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData, ExecuteTemplateDelegate executeTemplate) at System.Web.Mvc.Html.TemplateHelpers.TemplateHelper(HtmlHelper html, ModelMetadata metadata, String htmlFieldName, String templateName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.TemplateHelpers.TemplateFor[TContainer,TValue](HtmlHelper`1 html, Expression`1 expression, String templateName, String htmlFieldName, DataBoundControlMode mode, Object additionalViewData) at System.Web.Mvc.Html.DisplayExtensions.DisplayFor[TModel,TValue](HtmlHelper`1 html, Expression`1 expression, Object additionalViewData) at EPiServer.Web.Mvc.Html.PropertyRenderer.<>c__DisplayClass12_0`2.<GetHtmlForDefaultMode>b__0(StringWriter writer) at EPiServer.Web.Mvc.Html.PropertyRenderer.CreateMvcHtmlString(Action`1 action) at EPiServer.Web.Mvc.Html.PropertyRenderer.PropertyFor[TModel,TValue](HtmlHelper`1 html, String viewModelPropertyName, Object additionalViewData, Object editorSettings, Expression`1 expression, Func`2 displayForAction) at EPiServer.Web.Mvc.Html.PropertyExtensions.PropertyFor[TModel,TValue](HtmlHelper`1 html, Expression`1 expression, Object additionalViewData) at Apoteket.Core.EPi.Extensions.HtmlHelperExtensions.ContentAreaFor[TModel,TValue](HtmlHelper`1 htmlHelper, Expression`1 expression, Object additionalViewData) in D:\TeamCity\BuildAgent\work\faa4e25bfd84e34e\Src\Apoteket.Core\EPi\Extensions\HtmlHelperExtensions.cs:line 147

It comes from the following method:

    /// <summary>
    /// Find form container block which contains this element.
    /// <remarks>This function works because we have assumption that FormElement is direct child of FormContainer,
    /// FormElementBlock is stored inside LocalFolder of FormContainerBlock</remarks>
    /// </summary>
    /// <param name="element">The FormEchwslement.</param>
    public virtual FormContainerBlock FindOwnerForm()
    {
      IContent content1 = this.Content;
      if (content1 == null)
        return (FormContainerBlock) null;
      if (!(content1.ParentLink.GetContent((string) null) is ContentAssetFolder content2))
        return (FormContainerBlock) null;
      ILocalizable localizable = content1 as ILocalizable;
      return content2.ContentOwnerID.GetContent(localizable?.Language?.Name) as FormContainerBlock;
    }
#227129
Aug 28, 2020 7:09
Vote:
 

Edit: It works in edit mode using OPE.

#227130
Edited, Aug 28, 2020 7:12
Vote:
 

Any update/solution on this, we are experiencing the same thing?

Update: Found the issue as you mentioned to be connetcted to ParagraphElement specifically and our forms that used a paragraphelement created globally under Blocks failed to load. Copying the element to the form (For this form) and use that instead solves the issue. Other elements used in the same way works, it's only the Paragraphelement that causes the issue. Using Forms 4.30.0 for reference

#244882
Edited, Dec 11, 2020 7:31
Vote:
 

We are having the same issue. Any solution (other than the work around) to this yet?

#249907
Mar 11, 2021 14:04
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.