Cannot delete form records programmatically in background job #1069
Labels
release/8.13.11
state/sprint-candidate
We're trying to get this in a sprint at HQ in the next few weeks
type/bug
Bug summary
When trying to delete form records in a (Hangfire) background job, IRecordService.Delete() throws a httpContext null reference exception.
The problem was fixed in version 9.x in issue #779, but I am running forms version 8.13.7.
Reproduction
When trying to delete form records in a (Hangfire) background job, IRecordService.Delete() throws a httpContext null reference exception. The method Delete takes two parameters; a form and a record, and both parameters are valid (and not null).
See stack trace below for more information.
Specifics
Forms version 8.13.7
Calling IRecordService.Delete()
Steps to reproduce
Call IRecordService.Delete() from a Hangfire task
Expected result
Record is deleted
Actual result
Throws exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: httpContext
Call stack:
at System.Web.HttpContextWrapper..ctor(HttpContext httpContext)
at Umbraco.Forms.Core.Services.WorkflowService.ExecuteWorkflows(List`1 workflows, RecordEventArgs e)
at Umbraco.Forms.Core.Services.WorkflowService.ExecuteWorkflows(Record record, Form form, FormState state, Boolean editMode)
at Umbraco.Forms.Core.Services.RecordService.Delete(Record record, Form form)
at Brand.Energy.Core.Repositories.UmbracoFormsRepository.DeleteRecord(Form form, Record record) in Brand.Energy.Core\Repositories\DeleteFormReceiptRepository.cs:line 31
Possible fix
In may 2022, you fixed the issue in version 9.4.2, but out solution is running version 8.13.7.
Look in issue #779 : Cannot delete form records programmatically in background job.
The old issue was handled by @AndyButland
This item has been added to our backlog AB#32180
The text was updated successfully, but these errors were encountered: