Closed (fixed)
Project:
Translation Management Tool
Version:
8.x-1.x-dev
Component:
Core
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Mar 2016 at 17:10 UTC
Updated:
23 Mar 2016 at 13:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
berdirComment #3
miro_dietikerRemoving recursive parent reference... Dunno what was the proper target intended.
Comment #4
mbovan commentedComment #5
mbovan commentedAdded 2 new job states: Continuous and Continuous inactive.
Icons are from #2678332: Merge normal and continuous job overviews
Default state is "Continuous", while "Continuous inactive" is not in use yet. Should we automatically change to "Continuous inactive" when there are no entity types selected (for example)?
Also, do you happen now what steps I need to follow to change a continuous job to state "Finished"? Through user interface of course.
Screenshot:

Comment #7
berdirI'm not sure what I did. I might have accepted a job item.
so create a continuous job, create content, accept the translation for the job item. If it is the only one (or all are accepted), the job might currently switch to finished.
Comment #8
mbovan commentedYes, it appears to happen on "auto-accept" of job items where we change all jobs to finished. This patch should make it available only for non-continuous jobs.
Comment #10
mbovan commentedThis should fix the tests.
Do we need
continuous($message = NULL, $variables = array(), $type = 'status')andcontinuous_inactive($message = NULL, $variables = array(), $type = 'status')on JobInterface for now?Comment #11
mbovan commentedComment #12
berdirWe should make sure that the open_jobs filter includes this state too.
I'm not sure that this does what you think it does. Now it will simply never find unfinished jobs for continuous jobs, which means it will always try to finish them? Wouldn't you have to check this in \Drupal\tmgmt\Entity\JobItem::accepted?
My idea was to actually enforce this state in Job::preSave(). If continuous, and status is not continuous_inactive, force it to continuous.
Also, I think we want an update function for this, or filters might not work correctly on this.
Comment #13
mbovan commentedRe #12.2:
Ha, didn't see ! at the beginning of the method. Moved to JobItem::accepted().
Put the code for changing the state in Job::preSave(). I added a check if original job is not already in continuous state as it could lead to an infinite loop.
Comment #15
mbovan commentedDirectly setting the state to prevent double-saving. Double-save fix for job items too.
Comment #16
berdirTry reversing the conditions, if ($job && !$job->isContinuous() && ...check_finished()).
Then you avoid a query for continuous jobs.
looks like we forgot to make these labels translatable() in the previous issue?
Lets not make inactive visible in the UI when it's not used anywhere yet. So just add continuous.
I actually liked setState() here because then it only saves if necessary.
Comment #17
mbovan commentedFixed the points above.
Comment #19
berdirOk, committed.