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.

Issue fork tmgmt-3094355

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Andriy Khomych created an issue. See original summary.

andriy khomych’s picture

andriy khomych’s picture

Issue summary: View changes
andriy khomych’s picture

Issue summary: View changes
andriy khomych’s picture

Issue summary: View changes
andriy khomych’s picture

Issue summary: View changes
andriy khomych’s picture

miro_dietiker’s picture

I 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.

andriy khomych’s picture

Probably, 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?

p4trizio’s picture

Status: Active » Needs review

Patch works perfectly, thanks

Belialius’s picture

Can confirm that patch works as expected. Very useful functionality.

rajiv.singh’s picture

Rerolled patch for v 8.x-1.13

rajiv.singh’s picture

Fixed some code formatting in previous patch.

andriy khomych’s picture

Hey Miro Dietiker, it seems this functionality is quite useful.
Do you think we can merge this patch?

gebiss’s picture

Thanks,

Applied patch #7 on Drupal 10.2.3 and it works

firewaller’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -

Patch #13 (tmgmt-reset-finished-job-button-3094355-9.patch) works for us

The last submitted patch, 7: tmgmt-reset-finished-job-button-3094355-7.patch, failed testing. View results

charginghawk made their first commit to this issue’s fork.

charginghawk’s picture

Thank 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.

berdir made their first commit to this issue’s fork.

berdir’s picture

Unsure 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?

firewaller’s picture

If 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.

firewaller’s picture

FYI 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.

firewaller’s picture

StatusFileSize
new8.8 KB

Patch for 8.x-1.17 attached.

relim made their first commit to this issue’s fork.

riyas_nr’s picture

Rerolled patch with latest MR changes including job item reset.

claudiu.cristea’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

I 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.