Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon steed 378 posts 690 karma points
    4 days ago
    Simon steed
    0

    Umbraco forms custom workflow issue - RejectAsync still allows approved to fire

    I've got a custom workflow for v13 Cloud running, it's doing what it should do i.e. checks for spammy words and allows or accepts based upon a safelist. However when I reject, I set the following:

    _httpContextAccessor.HttpContext.Items[Constants.ItemKeys.RedirectAfterFormSubmitUrl] = "/404"; await _recordService.RejectAsync(context.Record, context.Form); return WorkflowExecutionStatus.Failed;

    This should stop any future workflows processing, however it doesn't. It still saves the record to the db and processes any other workflows, even in the OnApprove section.

    I have an OnApprove which is using the Send Template Email workflow (built in version). This is still being fired even though i'm rejecting and setting the status as failed. Why is this and how can I ensure records are not a) saved in the db and b) dont fire anymore workflows i.e. sending a mail out?

    Seems to be a key area fundamentally not working in a commercial product - I should have the option in all workflows to stop processing if any previous have failed surely?

  • Paul Sterling 719 posts 1536 karma points MVP 9x admin c-trib
    2 days ago
    Paul Sterling
    1

    The Reject stage is controlled by the "Enable post moderation" setting for each form. Completely not obvious I know! Once you have that set to True and have added a workflow(s) to the OnReject Stage you'll see workflows in the OnApprove Stage won't run once the submission has been rejected.

    This works for us with v13.3.3.

    enter image description here

  • Simon steed 378 posts 690 karma points
    1 day ago
    Simon steed
    0

    Cheers Paul - that all worked fine, amazing how a small undocumented feature can sort so many issues out - i've never even seen that setting in all the time i've been using Forms!

Please Sign in or register to post replies

Write your reply to:

Draft