Updated: Comment #N

Problem/Motivation

If you add source items into a job that is not submitted to a translator yet, the sources list lacks important data.
It looks like the item is not present in any job resulting in the risk to add it to multiples.

Proposed resolution

Not only show active job items, but also unprocessed in the source overview.
Same for the translate tabs.

Remaining tasks

User interface changes

API changes

Comments

blueminds’s picture

How do we want to show them? The same way as if a job is submitted/active - with blue marking? Also what to show in case of the translate tab?

Also, to tell if the job is active or not tmgmt_job_item_load_latest() function is used, which does not load jobs that are not yet submitted. Possibly we could add another argument to that function - the job state - to also return not submitted jobs.

berdir’s picture

I think that we ignore non-submitted jobs there is just an oversight, let's just add that state by default and check if causes any problems.

Yes, for now, display the them the same color, for the /translate tab, maybe use something like "Unsubmitted"? Not sure how much space we can/should use there.

blueminds’s picture

Status: Active » Needs review
StatusFileSize
new2.59 KB

Updated tmgmt_job_item_load_latest() to return also unprocessed jobs. Did run only general UI tests and node UI tests, so lets see if it passes for all.

berdir’s picture

Works quite well.

Looks like the job item view is broken for those, tested it with simplytest me, request translation, then go to the oveview, it is displayed as "Active", if you click on it, you get this:

Fatal error: Call to a member function reviewDataItemElement() on a non-object in /home/sb73216b9d9fbef8/www/sites/default/modules/tmgmt/ui/tmgmt_ui.module on line 675

I guess we call out to the translator without checking if there is one?

We should probably fix that and maybe this should link to the job and not the item?

the translate tab now shows unprocessed and the overview says active. We should unify that. Either add that special case for the overview too or go with Active in both cases. The code for active would be easier but if we do the link to job thing, also changing the label would be trivial, so lets do that?

The link for /translate already goes to the item, and I kind of expected that now that I think about it, also makes me wonder if you saw the fatal error too :)

Summary:
- On overview, display as Unprocessed with link to job, just like /translate
- fix the fatal error while we touch it if it's just a single or two cases, if we have to change more, ignore it.

miro_dietiker’s picture

Status: Needs review » Needs work

According Berdir review.

blueminds’s picture

Status: Needs work » Needs review
StatusFileSize
new5.03 KB
new2.63 KB

Please see the patch.

We might update the access function for job item to restrict permission to the review form in case there is no translator, i.e.:

function tmgmt_job_item_access($op, TMGMTJobItem $item = NULL, $account = NULL) {
  // If the job is not yet submitted the view and edit action of an item may
  // cause fatal error as review form builder expects the translator to be
  // available.
  if (!empty($item) && $item->getTranslator() == NULL && in_array($op, array('view', 'edit'))) {
    return FALSE;
  }
  // There are no item specific permissions yet.
  return tmgmt_job_access($op, $item ? $item->getJob() : NULL, $account);
}

Not sure however if this is not a different issue.

blueminds’s picture

Added condition to prevent the reviewDataItemElement fatal error.

The last submitted patch, 6: 2182103-unprocessed_status-2.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: 2182103-unprocessed_status-3.patch, failed testing.

blueminds’s picture

Status: Needs work » Needs review
StatusFileSize
new6.11 KB
new749 bytes

fixing test

berdir’s picture

Status: Needs review » Fixed

Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.