Copied to clipboard

Flag this post as spam?

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


  • Jesse Andrews 191 posts 716 karma points c-trib
    Jun 28, 2019 @ 18:23
    Jesse Andrews
    0

    Is there a way to run logic only on reset?

    I have a couple database entries that need to updated when a job is reset back to the submitted state, but don't need to be touched in the normal submission flow at that point. I would prefer to avoid the unneeded sql call if possible, so is there a method that only triggers on reset or something I can check in the Submit method to determine whether the request originated from a reset?

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Jul 04, 2019 @ 13:54
    Kevin Jump
    100

    Hi Jesse,

    There wasn't an event for restting so we've added it into the next release - which we've pushed live today.

    http://jumoo.localhost/translate/releases/2.3.0/

    you should now be able to listen for ResetJob

        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            TranslationJobService.ResetJob += TranslationJobService_ResetJob;
        }
    
        private void TranslationJobService_ResetJob(TranslationStatusEventArgs e)
        {
            // e.Job - job with current (new status) in it
            // e.OldStatus - status job has been reset from 
        }
    
  • Jesse Andrews 191 posts 716 karma points c-trib
    Jul 08, 2019 @ 16:23
    Jesse Andrews
    0

    Thanks for adding that Kevin.

Please Sign in or register to post replies

Write your reply to:

Draft