Hi, I'm working on a form where members will hopefully be able to edit their account details.
In both the Umbraco back office and codefirst form class I've tried setting DefaultValue = "{member.email}" or "{member.postcode}" etc. But every time I assign the default value, the form doesn't render and throws this error:
An item with the same key has already been added.
I've ticked the 'Member can edit' boxes for each field in the member type section, but it has made no difference.
The error message only occurs if I'm logged in as a member, if no member is logged in then the form renders fine.
I've also tried changing the field names so they are different to the names of the fields on the registration form; for example Email to EditedEmail, and that has made no difference either.
Does anyone have any ideas as to what could be going wrong here? I'm happy to post code/answer any questions, I just want to find a way to make this work!
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Umbraco.Forms.Data.StringHelper. . . ()
at Umbraco.Core.CacheHelper.<>c__DisplayClass2`1.<GetCacheItem>b__0()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Umbraco.Core.Cache.HttpRuntimeCacheProvider.GetCacheItem(String cacheKey, Func`1 getCacheItem, Nullable`1 timeout, Boolean isSliding, CacheItemPriority priority, CacheItemRemovedCallback removedCallback, CacheDependency dependency)
at Umbraco.Core.CacheHelper.GetCacheItem[TT](String cacheKey, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, TimeSpan timeout, Func`1 getCacheItem)
at Umbraco.Forms.Data.StringHelper. (String , Object )
at Umbraco.Forms.Data.StringHelper.ParsePlaceHolders(HttpContext Context, Record record, String value)
at Umbraco.Forms.Mvc.Models.FormViewModel.<FetchPrevalues>b__b(PreValue pv) in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.Mvc\Models\FormViewModel.cs:line 234
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Umbraco.Forms.Mvc.Models.FormViewModel.FetchPrevalues(Field field) in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.Mvc\Models\FormViewModel.cs:line 234
at Umbraco.Forms.Mvc.Models.FormViewModel.Build() in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.Mvc\Models\FormViewModel.cs:line 132
at Umbraco.Forms.Mvc.Controllers.FormRenderController.ContourForm() in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.Mvc\Controllers\FormRenderController.cs:line 72
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.ControllerActionInvoker.<>c__DisplayClass13.<InvokeActionMethodWithFilters>b__10()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
Can't pre-populate form fields
Hi, I'm working on a form where members will hopefully be able to edit their account details.
In both the Umbraco back office and codefirst form class I've tried setting DefaultValue = "{member.email}" or "{member.postcode}" etc. But every time I assign the default value, the form doesn't render and throws this error:
I've ticked the 'Member can edit' boxes for each field in the member type section, but it has made no difference.
The error message only occurs if I'm logged in as a member, if no member is logged in then the form renders fine.
I've also tried changing the field names so they are different to the names of the fields on the registration form; for example Email to EditedEmail, and that has made no difference either.
Does anyone have any ideas as to what could be going wrong here? I'm happy to post code/answer any questions, I just want to find a way to make this work!
I'm using Contour 3.0.21 and Umbraco 7.1.6.
Thanks
Robby
To give you more info, here's the stack trace:
is working on a reply...