Closed (fixed)
Project:
Translation Management Tool
Version:
7.x-1.x-dev
Component:
Translator: Local
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
22 Jan 2013 at 10:49 UTC
Updated:
12 May 2013 at 20:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
cgalli commentedReassign to tmgmt_local
Comment #2
miro_dietikerComment #3
berdirI'm working on this, needs task_item entity first.
Comment #4
berdirThat took quite a bit longer than expected, typical task that grew too big.
This is not yet complete, most importantly, it's missing the main point of this issue, storing partial translates in task_item entity.
It however does a lot already:
- Introduces task_item entity with an 1:1 mapping to job items
- Separate statuses for that (untranslated, translated (means pending review by job requester), rejected (not yet implemented) and completed (marked once job item was accepted)
- Improved permission handling, although tmgmt_local_translation_access() is still around (should be merged into entity access)
- Refactored views a lot. Single operations column, using local tasks with user-menu links instead of links in the sidebar, updated to use the task_entity, improved assign etc. permission checks
The most important parts that are missing currently are:
- Storing the translations in the task item until it's saved as completed, then copy it over to the job item, removing the custom write and status changes.
- Adding the progress stuff to task items, this could be a follow-up?
Comment #5
berdirAlso, upgrade path is missing.
Comment #6
cgalli commentedApplied the patch to a new install. It looks good (tabs instead of menu, changed naming of action links etc).
I found the follwing difficulties:
The 'unassign' link is a very good idea. But it does not yet seem to work correctly. Changing only the status to 'unassigned' (but leaving the persons name on myself) list the task as unassigned to me. When changing the status and the assigned person, it works fine.
In the translation pane, using teh ckeckmark button leads to an ajax error:

When using with 'auto accept' off, finishing a translation leads to:
- In the node source list, the yellow square shows correctly
- In the translation management overview and detail, the 'review' link does not show. The job message is displayed, but the status (including colored circle) remains on blue/pending.
- in the review pane, the job items show in gray, but can be checked and turn to green.
- Saving the job as completed leads to status 'accepted' and the translation is created.
Comment #7
cgalli commentedQuick addition:
The 'Local Task' tab does not show up anymore in translation management.
Comment #8
berdirOk, that turned out to be quite easy, actually, and surprisingly nice.
The attached patch fixes/does the following (order as it's in the interdiff):
- Improved entity label that uses the title when given and makes the assigned to part optional
- Copies the updateData() and getData() methods from JobItem to TaskItem.
- Updates some action/form access logic (hide form elements if you are not allowed to change them, only display translate link to someone who is assigned to the task, only show unassign if someone is assigned, ...)
- Makes the list of task items shown on the task page actually specific for that task ;)
- Should fix and propertly re-introduce the unassign action
- Saves translations in the task item and then copies them over on save as completed.
- Fixed the ajax error
- Updates the upgrade path to copy over existing translations from the job item to the task item.
- Using the links class on the operations so that they don't have tons of spacing as before
This should be pretty close, the only major part that's missing are the status counters.
Comment #9
berdirOh wow, just picked the latest patch with interdiff in my patches directory.. unfortunately, it was the 8.x patches directory :p
Comment #10
berdirIt's pretty awesome that this just works like that ;)
Comment #12
berdir#9: task-entity-1895380-8.patch queued for re-testing.
Comment #13
cgalli commentedApplied the path to existing installation.
The upgrades (7000 and 7001) passed fine.
When I tried to finish a previously started job (Drupal Translator, not Local), 'Save as completed' did not finish the job, the review pane is still active. Hitting it again leads to:
Fatal error: Call to a member function completed() on a non-object in /var/www/tmgmt/sites/all/modules/tmgmt/translators/tmgmt_local/tmgmt_local.module on line 722
Previously started jobs with Local Tranlslator came back without any problem.
Started new job, submitted it to Local.
Hitting 'Translate' (http://tmgmt.hookuser.ch/translate, as a translating user) leads to:
Fatal error: Call to a member function isActive() on a non-object in /var/www/tmgmt/sites/all/modules/tmgmt/translators/tmgmt_local/tmgmt_local.module on line 257
'Manage translation tasks' can be used.
Comment #14
miro_dietikerAre you sure you're not having the module/project twice and there's an unpatched and a patched version in place (check all modules directories)?
Did you drush cc all?
Please confirm.
Comment #15
cgalli commentedyes. did it again, does not change.
Comment #16
berdir- Fixed the error when saving a job item from a different translator as completed.
- The other fatal error I think is because you have old translation tasks that point to deleted jobs. Added a check for that for now, the whole function needs to be integrated into the entity access system anyway.
- Made some more small updates to the task overview (/translate) view, somehow got moved back to the navigation menu.
Comment #17
miro_dietikerInterdiff - feasible... Few text fixes required.
elegible => eligible
unasigned => unassigned
Please check similar nonfunctional occurrences too...
Comment #18
cgalli commentedInstalled the patch (not interdiff) on existing installation. update works fine.
Looking excellent, it's a friggin cool system by now!
I tried to test different combination (node, entity) but found no major functional problem. Some remaks about logic below.
Upgrade path
- Returning jobs from Drupal Translator can be reviewed and saved, no problem
- Same for local jobs created before the patch.
Remarks:
The status circles in the two worlds are still corresponding.
When completeing a task (Save as complete) shouldn't we redirect to the 'translate' page?
In the Local Translator, a completed task item can be viewed (which is good). But the 'Save'/'Save as completed' buttons are still active, which does not make sense for a finished job? The same goes for the Data Item check marks.
A completed task can still be unassigned. We need to decide if this makes sense. If it does, there should be a status column in the upper list.
Deleting a job in core leads to a notice in the translator:
Notice: Trying to get property of non-object in tmgmt_local_task_form() (line 48 of /var/www/tmgmt/sites/all/modules/tmgmt/translators/tmgmt_local/includes/tmgmt_local.pages.inc).
Makes sense, but possibly leaves a dangling entity somewhere. The task is still listed in lower table, no word count, no item count
Comment #19
cgalli commentedComment #20
berdirFixed some more. Haven't introduced those strings, just started to fix those that I noticed.
Comment #21
berdirThanks for testing. Some feedback.
- Yes, the current word counts are still joined in from the job/ job item I think. Need to update that to store the statistics in the local task item.
- Redirect should probably depend on whether there are more task items in the task or not.
- Wasn't sure about handling the buttons on completed task items, agree that hiding them makes sense on completed task items. Needs a back link or something like that, then.
- On the task, we currently have completed *and* closed. Right now, a task is set to completed if all task items within are translated. Closed is not yet implemented, I assume we should set it to closed once all task items are completed just like the job is finished after all job items are accepted. Which makes me wonder if completed is the right status for task items. Maybe it would make more sense to name it accepted as well? Untranslated => Translated (TBD: => Revision requested) => Accepted ?
- So, the changing the assignment of a completed job could be allowed although not sure if it's useful, of a closed job probably not. At least not directly on the operations, an admin could still edit the job and change it there...
Comment #22
berdirThis needs to get in :)
- Added data item status/progress for local task items: Untranslated/Translated/Completed
- Changed the statuses of local task items from Untranslated/Translated/Completed to Pending/Completed (everything translated)/Closed (job item accepted)
- Also implemented that tasks are closed when all contained task items are closed.
- Updated the my tasks view to exclude closed tasks, they can be access through the closed tab.
- Updated TMGMTLocalTask::getItems() to return task items and not job items.
- Updated/extended tests.
- Redirect is now dynamic, based on wether task has additional untranslated items, as long as that's the case you go back to the task detail page, /translate otherwise.
Comment #24
cgalli commentedApplied patch
- Update leads to:
Notice: Undefined index: update_success in update_results_page() (line 177 of /var/www/tmgmt/update.php).
Warning: array_pop() [function.array-pop]: The argument should be an array in update_results_page() (line 181 of /var/www/tmgmt/update.php).
When saving a task item (not save as complete) I get
•Notice: Trying to get property of non-object in tmgmt_local_task_form() (line 48 of /var/www/tmgmt/sites/all/modules/tmgmt/translators/tmgmt_local/includes/tmgmt_local.pages.inc).
•Notice: Trying to get property of non-object in tmgmt_local_task_form() (line 48 of /var/www/tmgmt/sites/all/modules/tmgmt/translators/tmgmt_local/includes/tmgmt_local.pages.inc).
The labels of the task items do NOT show.
When choosing one of the items, I get:
Fatal error: Call to a member function getJob() on a non-object in /var/www/tmgmt/sites/all/modules/tmgmt/translators/tmgmt_local/includes/tmgmt_local.pages.inc on line 138
And now I am blocked.
Comment #25
berdirFixed the typo in the tests and added hooks to delete tasks and task items when jobs are deleted. Your errors are related to that I think but I can't fix existing data inconsistencies.
Comment #26
berdirDecided to go ahead and commited it. It's not perfect but I think it's a huge improvement and the local translator starts to get actually usable with this. We can deal with bugs in follow-ups.