Sometimes we need to reset the finished job to it's active state .
Example use case:
- You have xliff file translations.
- Translators updated xliff file.
- You imported it and then reviewers found some bugs in translations.
- Translators updated original xliff file.
- You tried to reimport it, but the job is finished and you cannot do it.
Currently, to do this, you need to recreate every time job, provide a new file for the translator, import it and use it. Moreover, we cannot use resubmit features from the existing job (I don't know why, but I assume it will have conflicts that's why operation resubmit is unavailable).
IMHO, it is a bit tedious.
My proposal is to add a reset button on the job and you can reset it to an active state. Then you can import an existing file into the job after some updates in the file.
Comments
Comment #2
andriy khomych commentedComment #3
andriy khomych commentedComment #4
andriy khomych commentedComment #5
andriy khomych commentedComment #6
andriy khomych commentedComment #7
andriy khomych commentedComment #8
miro_dietikerI guess this only makes sense for the File translator?
Maybe for others as well, but we can not always add it:
Resetting a job that is connected to some Cloud SaaS provider will cause pain.
Comment #9
andriy khomych commentedProbably, but I assume it can be useful even in this case, without recreating the job to rerun it by SaaS provider. From my point of view, we can add specific permission and allow only to special roles to reset it, similar to resubmit/delete the job. What do you think about it, Miro Dietiker?
Comment #10
p4trizio commentedPatch works perfectly, thanks
Comment #11
Belialius commentedCan confirm that patch works as expected. Very useful functionality.
Comment #12
rajiv.singh commentedRerolled patch for v 8.x-1.13
Comment #13
rajiv.singh commentedFixed some code formatting in previous patch.
Comment #14
andriy khomych commentedHey Miro Dietiker, it seems this functionality is quite useful.
Do you think we can merge this patch?
Comment #15
gebiss commentedThanks,
Applied patch #7 on Drupal 10.2.3 and it works
Comment #16
firewaller commentedPatch #13 (tmgmt-reset-finished-job-button-3094355-9.patch) works for us
Comment #20
charginghawk commentedThank you for this! I opened an MR with the #13 patch. I also wanted the option to be available in more places, so I added it to more spots as well as job items.
Comment #22
berdirUnsure about this. I see the use case, but so far, we deliberately didn't support this. The behavior is also going to vary between different providers. Providers where you submit data, set up mappings and then check for updates are likely going to be confused by this reset. And it might also be unclear when to use reset vs resubmit.
Maybe it should use a more restrictive permission or its own, so that usage of this is more flexible. Or providers should indicate that they support such a reset?
Comment #23
firewaller commentedIf there are different use-cases based on setup does it make sense to add config to optionally enable the reset functionality? I'd be concerned about relying on the provider itself since that may be up to the individual site instead.
Comment #24
firewaller commentedFYI this patch applies to 8.x-1.17 but introduces a regression when viewing the node's Translation Jobs tab:
Error: Class "Drupal\tmgmt\Entity\ListBuilder\Url" not found in Drupal\tmgmt\Entity\ListBuilder\JobListBuilder->getDefaultOperations() (line 41 of /opt/app-root/src/web/modules/contrib/tmgmt/src/Entity/ListBuilder/JobListBuilder.php).I will reroll a new patch.
Comment #25
firewaller commentedPatch for 8.x-1.17 attached.
Comment #28
riyas_nr commentedRerolled patch with latest MR changes including job item reset.
Comment #29
claudiu.cristeaI think this should be a translator business. E.g., what happens when you reset to active the job item of a continuous job? It will stay active but will nothing will happen. In the case of continuous jobs is the translator who sets the job item active. I think it should be translator who reset the state to active.