[NullReferenceException: Object reference not set to an instance of an object.]
Umbraco.Forms.Data.Storage.RecordFieldStorage.UpdateRecordField(RecordField recordField) +163
Umbraco.Forms.Data.Storage.RecordStorage.UpdateRecord(Record record, Form form) +821
Umbraco.Forms.Web.Services.RecordService.storeRecord(Record record, Form form) +216
Umbraco.Forms.Web.Services.RecordService.Approve(Record record, Form form) +157
Umbraco.Forms.Web.Services.RecordService.Submit(Record record, Form form) +366
I ran into this too and it was to do with the "Field" property of the RecordField that it was trying to update. In fact it was trying to update the "Page" subtype, which I'm pretty sure isn't supposed to be updated?
Either way, if you run this against your record before you call UpdateRecord, that will crash out to tell you what is popping a null in the relevant field and you can tinker around with it:
Of course if you're using the regular built-in Forms controller there's not a lot you can do with it unfortunately. If the problem shows up in multi-page forms this is probably a bug in the way Forms handles pages.
I had an issue where I was getting a null object reference whenever I tried to update a record (I'm assuming because the form had since changed). The solution was to loop through the RecordFields and remove any that had a null Field:
foreach (var kvp in rec.RecordFields.ToList())
{
if (kvp.Value.Key != Guid.Empty)
{
var recordField = kvp.Value;
if (recordField.Field == null)
{
rec.RecordFields.Remove(kvp.Key);
}
}
}
rs.UpdateRecord(rec, form);
NullReferenceException in UpdateRecordField
Hi
I'm seeing an exception after submitting a form in Umbraco Contour. I'm running a nightly build:
http://nightly.umbraco.org/UmbracoForms/nightlies/UmbracoForms.Files.4.2.0-WIP.Build.65.zip
[NullReferenceException: Object reference not set to an instance of an object.] Umbraco.Forms.Data.Storage.RecordFieldStorage.UpdateRecordField(RecordField recordField) +163 Umbraco.Forms.Data.Storage.RecordStorage.UpdateRecord(Record record, Form form) +821 Umbraco.Forms.Web.Services.RecordService.storeRecord(Record record, Form form) +216 Umbraco.Forms.Web.Services.RecordService.Approve(Record record, Form form) +157 Umbraco.Forms.Web.Services.RecordService.Submit(Record record, Form form) +366
More details, fiddler trace and the form JSON are here: http://issues.umbraco.org/issue/CON-816
Thanks!
Tom
I ran into this too and it was to do with the "Field" property of the RecordField that it was trying to update. In fact it was trying to update the "Page" subtype, which I'm pretty sure isn't supposed to be updated?
Either way, if you run this against your record before you call UpdateRecord, that will crash out to tell you what is popping a null in the relevant field and you can tinker around with it:
Of course if you're using the regular built-in Forms controller there's not a lot you can do with it unfortunately. If the problem shows up in multi-page forms this is probably a bug in the way Forms handles pages.
This helped me a ton, thanks!
I had an issue where I was getting a null object reference whenever I tried to update a record (I'm assuming because the form had since changed). The solution was to loop through the RecordFields and remove any that had a null Field:
is working on a reply...