Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We only set job items to active when the old status is unprocessed. If a job is rejected, then the status is set to rejected and afterwards, the job itesm are not activated.
Proposed resolution
Activate job items if the previous job state was unprocessed or rejected (or if the status is not active?)
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#13 | rejectedjobstatus.png | 146 KB | jansi.n |
#13 | joblogs.png | 105.96 KB | jansi.n |
#8 | job_items_not_active_if_rejected-2695217-8.patch | 4.6 KB | tduong |
| |||
#8 | job_items_not_active_if_rejected-2695217-8-test_only.patch | 1.81 KB | tduong |
| |||
#6 | job item submit.png | 114.66 KB | tduong |
Comments
Comment #2
tduong CreditAttribution: tduong at MD Systems GmbH commentedComment #3
tduong CreditAttribution: tduong at MD Systems GmbH commentedEdited Job::preSave() check, added test, small refactoring.
Screenshots:
Comment #4
BerdirThat's not the idea. reject should not set it to active. only active should.
You need to resubmit the same job in the test.
First try with reject, that will change the status to rejected. check that status is reject and inactive. Then submit the same job again, this time with submit. Then check that job and item is active.
It would be a lot faster if we could do this through the API, for example in TmgmtCrudTest. set $job->translator and $job->settings['action'] (I think), then requestTranslation().
Comment #6
tduong CreditAttribution: tduong at MD Systems GmbH commentedRestarted as suggested above: changed fix and rewrote test, thus no interdiff.
Screenshots to see the job/job item states of the test's steps:
Comment #8
tduong CreditAttribution: tduong at MD Systems GmbH commentedAfter discussion with @Berdir, moved the test to
tmgmt/tests/src/Kernel/CrudTest.php
and improved it (for performance/complexity reason).Comment #9
BerdirBe careful with unrelated fixes. You risk that your patch conflicts with others that might be changing those lines as well for another reason. Only fix coding standards and documentation in lines that you touch anyway.
Test looks good now. Was confused why you added the use, the problem was actually something else, the namespace was wrong. Fixed and committed:
Comment #11
tduong CreditAttribution: tduong at MD Systems GmbH commentedAbout the unrelated fixed: ok! :)
About the namespace: why is it
Drupal\Tests\tmgmt\Kernel
? Is there something special for kernel folders / Unit tests ?I'm confused how the test_only patch could pass, and why this is fine since you have committed it :/
Comment #13
jansi.n CreditAttribution: jansi.n at UniMity Solutions Pvt Limited commentedBelow section details the steps of how for a rejected job, even if we succeed from memsource provider the job status doesn’t change to inprogress as expected. We are using TMGMT 8.1.12. Can you suggest if you can assist with a patch for this version to fix our issue?
Thanks!
Steps followed to replicate issue:
1. While creating Jobs and sending to memsource, we encountered that the jobs were “rejected”. The status of Job was set as Rejected.
2. On resending the same job, the Job was accepted by Memsource, the accepted ID was recorded in the log of the specified Job.
3. Though the Job was successfully submitted to memsource, the job status continued to be as “rejected”.
4. Completed the translation of this Job in Memsource
5. Unable to pull the translations back from memsource as the Job was in “rejected” state