Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
at Microsoft.AspNetCore.WebUtilities.MultipartReaderStream.<ReadAsync>d__38.MoveNext()
at System.Threading.Tasks.ValueTask`1.get_Result()
at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
at Microsoft.AspNetCore.WebUtilities.StreamHelperExtensions.<DrainAsync>d__3.MoveNext()
at Microsoft.AspNetCore.WebUtilities.MultipartReader.<ReadNextSectionAsync>d__20.MoveNext()
at Microsoft.AspNetCore.Http.Features.FormFeature.<InnerReadFormAsync>d__24.MoveNext()
at Microsoft.AspNetCore.Http.Features.FormFeature.ReadForm()
at Klaranatet.Web.Core.Infrastructure.EpiServerForms.SubmissionActors.SendEmailAfterSubmissionActor.SendMessage(EmailTemplateActorModel emailTemplateActorModel) in C:\Users\Utv2\Projects\Klaranatet.Web\Klaranatet.Web.Core\Infrastructure\EpiServerForms\SubmissionActors\SendEmailAfterSubmissionActor.cs:line 120
Hi Krisoffer,
It's a known bug of Opti form.
A temporary workaround is your actor need to implement ISyncOrderedSubmissionActor
and set the IsSyncedWithSubmissionProcess to true.
public class SendEmailAfterSubmissionActor: EPiServer.Forms.Implementation.Actors.SendEmailAfterSubmissionActor
{
..........
public override bool IsSyncedWithSubmissionProcess => true;
}
I know that, when implementing the ISyncOrderedSubmissionActor
, the actors will run as synchronously instead of Async. But it is the only temporary solution while waiting for the issue to be fixed.
Hi!
After upgrade to .net 9 and CMS 12.32.2 we get an error when we are trying to read the HttpRequestContext. Forms are version 5.10.2
This is the code:
public class SendEmailAfterSubmissionActor : EPiServer.Forms.Implementation.Actors.SendEmailAfterSubmissionActor { private readonly SmtpSettings _smtpSettings; private readonly PlaceHolderService _placeHolderService; private readonly SmtpClient _smtpClient; private readonly XhtmlRenderService _xhtmlRenderService; public SendEmailAfterSubmissionActor(SmtpSettings smtpSettings, PlaceHolderService placeHolderService, XhtmlRenderService xhtmlRenderService) { _smtpSettings = smtpSettings; _placeHolderService = placeHolderService; _xhtmlRenderService = xhtmlRenderService; _smtpClient = new(_smtpSettings.Host, _smtpSettings.Port) { DeliveryMethod = _smtpSettings.DeliveryMethod, PickupDirectoryLocation = _smtpSettings.PickupDirectoryLocation }; } public override object Run(object input) { if (!(Model is IEnumerable<EmailTemplateActorModel> emailTemplateActorModels) || !emailTemplateActorModels.Any()) { _logger.Debug("There is no collection of EmailTemplateActorModel for this actor to work."); return null; } foreach (var actorModel in emailTemplateActorModels) { SendMessage(actorModel); } return null; } public void SendMessage(EmailTemplateActorModel emailTemplateActorModel) { ... if (HttpRequestContext?.Form?.Files != null && HttpRequestContext.Form.Files.Count > 0) ... }
And it gives me this error
Unexpected end of Stream, the content may have already been read by another component
I can watch the object in debug mode and Form is null, since it is a post I guess there should be a form available?
Does any know why this is happening?
Thanks!
/Kristoffer