Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Sep 20, 2016 @ 14:49
    Frans de Jong
    0

    Use member data in forms

    Hi all,

    I want to use member name and other custom member properties from the currentloggedin member to prefill forms.

    I tryed {member.Name} but I got a null reference error in the InsertUmbracoForm partial view macro.

    Can I access this data via the bracket notation or is there a way to make this info accessible to forms?

    Thanks

  • Kerri Mallinson 113 posts 497 karma points
    Sep 20, 2016 @ 15:21
    Kerri Mallinson
    1

    Hi Frans,

    You should be able to set the field default value to {member.loginname}, {member.id}, {member.email} or other customer properties using {member.yourcustomalias}, is this where you are trying to put it? Are you logged in when you get the null reference error?

    Kerri

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Sep 21, 2016 @ 08:14
    Frans de Jong
    0

    Hi Kerri,

    Thanks for your reply. I thought It would work like that but it somehow doesn't...

    I get the following error:

        Server Error in '/' Application.
    
    Object reference not set to an instance of an object.
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
    
    Source Error: 
    
    
    Line 14:     }
    Line 15: 
    Line 16:     Html.RenderAction("Render", "UmbracoForms", new {formId = g, recordId = recordGuid });
    Line 17: }
    
    Source File: c:\Users\Frans\Documents\Visual Studio 2015\Projects\Umbraco_FormsMemberTest\Umbraco_FormsMemberTest\Views\MacroPartials\InsertUmbracoForm.cshtml    Line: 16 
    
    Stack Trace: 
    
    
    [NullReferenceException: Object reference not set to an instance of an object.]
       Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency) +963
       Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles) +107
       Umbraco.Core.Cache.DeepCloneRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles) +114
       Umbraco.Forms.Core.Cache.CacheProviderExtensions.GetCacheItem(IRuntimeCacheProvider provider, String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, String[] dependentFiles) +225
       Umbraco.Forms.Data.StringHelper.ParseMemberPlaceholders(String value, Object memberKey) +1600
       Umbraco.Forms.Data.StringHelper.ParsePlaceHolders(HttpContext context, Record record, String value) +587
       Umbraco.Forms.Data.StringHelper.ParsePlaceHolders(HttpContext context, String value) +50
       Umbraco.Forms.Core.Extensions.StringExtensions.ParsePlaceHolders(String text) +56
       Umbraco.Forms.Mvc.Models.FormViewModel.FetchDefaultValue(Field field) +227
       Umbraco.Forms.Mvc.Models.FormViewModel.Build(Form form) +7314
       Umbraco.Forms.Web.Controllers.UmbracoFormsController.Render(Guid formId, Nullable`1 recordId, String view, String mode) +687
       lambda_method(Closure , ControllerBase , Object[] ) +314
       System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
       System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +157
       System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
       System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22
       System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
       System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50
       System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225
       System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225
       System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225
       System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225
       System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10
       System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
       System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26
       System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
       System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
       System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
       System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
       System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.Mvc.<>c__DisplayClassa.<EndProcessRequest>b__9() +22
       System.Web.Mvc.<>c__DisplayClass4.<Wrap>b__3() +10
       System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +27
       System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Action action) +64
       System.Web.Mvc.ServerExecuteHttpHandlerAsyncWrapper.EndProcessRequest(IAsyncResult result) +71
       System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1438
    
    [HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.]
       System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +3452905
       System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +77
       System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +29
       System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +24
       System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +463
       System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, Object routeValues) +45
       ASP._Page_Views_MacroPartials_InsertUmbracoForm_cshtml.Execute() in c:\Users\Frans\Documents\Visual Studio 2015\Projects\Umbraco_FormsMemberTest\Umbraco_FormsMemberTest\Views\MacroPartials\InsertUmbracoForm.cshtml:16
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90
       System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +235
       System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +113
       Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult) +200
       Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content) +613
       Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, INode node) +125
       umbraco.macro.LoadPartialViewMacro(MacroModel macro) +50
       umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId) +1174
       Umbraco.Web.UmbracoComponentRenderer.RenderMacro(macro m, IDictionary`2 parameters, page umbracoPage) +360
       Umbraco.Web.UmbracoComponentRenderer.RenderMacro(String alias, IDictionary`2 parameters, page umbracoPage) +72
       Umbraco.Web.UmbracoComponentRenderer.RenderMacro(String alias, IDictionary`2 parameters) +41
       Umbraco.Web.PropertyEditors.ValueConverters.<>c__DisplayClass7.<RenderRteMacros>b__1(String macroAlias, Dictionary`2 macroAttributes) +237
       Umbraco.Core.Macros.MacroTagParser.ParseMacros(String text, Action`1 textFoundCallback, Action`2 macroFoundCallback) +580
       Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.RenderRteMacros(String source, Boolean preview) +264
       Umbraco.Web.PropertyEditors.ValueConverters.RteMacroRenderingValueConverter.ConvertDataToSource(PublishedPropertyType propertyType, Object source, Boolean preview) +100
       Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedProperty.get_Value() +58
       Umbraco.Web.Models.DynamicPublishedContent.TryGetUserProperty(GetMemberBinder binder) +105
       Umbraco.Web.Models.<>c__DisplayClass9.<TryGetMember>b__6(Func`2 m) +14
       System.Linq.WhereSelectListIterator`2.MoveNext() +99
       System.Linq.WhereEnumerableIterator`1.MoveNext() +209
       Umbraco.Web.Models.DynamicPublishedContent.TryGetMember(GetMemberBinder binder, Object& result) +251
       CallSite.Target(Closure , CallSite , Object ) +140
       ASP._Page_Views_Partials_umbTextPage_cshtml.Execute() in c:\Users\Frans\Documents\Visual Studio 2015\Projects\Umbraco_FormsMemberTest\Umbraco_FormsMemberTest\Views\Partials\umbTextPage.cshtml:9
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +90
       System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +235
       System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +113
       System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +277
       System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper htmlHelper, String partialViewName, Object model) +58
       ASP._Page_Views_Overflow_cshtml.Execute() in c:\Users\Frans\Documents\Visual Studio 2015\Projects\Umbraco_FormsMemberTest\Umbraco_FormsMemberTest\Views\Overflow.cshtml:57
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
       System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +235
       System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +113
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +290
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +56
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +52
       System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +173
       System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
       System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
       System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
       System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
       System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9744373
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    
  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 21, 2016 @ 08:25
    Dennis Aaen
    100

    Hi Frans,

    You have hit into this issue http://issues.umbraco.org/issue/CON-841, and it is fixed in the next version of Umbraco Forms 4.3.3.

    If you can´t wait until the Umbraco Forms 4.3.3 is released then you can download the latest nightly build here.

    http://nightlies.s1.umbraco.io/?container=umbraco-forms-nightlies

    /Dennis

  • Frans de Jong 548 posts 1840 karma points MVP 4x c-trib
    Sep 21, 2016 @ 08:31
    Frans de Jong
    0

    Hi Dennis,

    Is there a estimated releasedate?

    Frans

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Sep 21, 2016 @ 08:59
    Dennis Aaen
    0

    Hi Frans,

    I know that we are working very hard to get the new Umbraco Forms 4.3.3 out soon, but I can´t give you a specific release date.

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft