Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am following this documentation to add a custom Umbraco form export:
However when i call: _formRecordSearcher.QueryDataBase(filter)
I am getting a user null ref error:
Value cannot be null. Parameter name: user
at Umbraco.Core.Models.UserExtensions.HasAccessToSensitiveData(IUser user) in d:\a\1\s\src\Umbraco.Core\Models\UserExtensions.cs:line 202
It seems like maybe some sort of permission issue or it doesnt have the umbraco context for security? Anyone have any ideas?
For anyone who might come across this....
In my service before I called _formRecordSearcher.QueryDataBase(filter) I had to insert the line:
HttpContextBase wrapper = new HttpContextWrapper(HttpContext.Current);
UmbracoBackOfficeIdentity user = wrapper.GetCurrentIdentity(true);
...which i guess forces the user identity.
Also, for the filter model passing in, it looked something like this:
RecordExportFilter recordExportFilter = new RecordExportFilter
StartDate = request.DateFrom,
EndDate = request.DateTo,
Form = new Guid(request.FormGuid),
SortOrder = RecordSorting.Descending,
SortBy = "Created",
ExportType = "",
Filter = "",
LocalTimeOffset = -120,
StartIndex = 1,
Length = 0,
States = new List<FormState>()
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted