Closed (fixed)
Project:
Translation Management Tool
Version:
7.x-1.x-dev
Component:
Core
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
8 Feb 2013 at 13:28 UTC
Updated:
17 Mar 2013 at 08:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
blueminds commentedSee attached patch
Comment #2
miro_dietikerSeems fine. (although i don't really like the settings key - it says what it does.)
Comment #3
miro_dietikerSame as with the other pseudo-setting:
This is nothing that is a real setting. So it should not clash with persisted (and user overridable) settings per instance.
It's more of a capability per translator plugin (type) and thus should go a level higher in the plugin_info data.
Comment #4
blueminds commentedFixed the settings part.
Comment #5
miro_dietikerThis is from a different issue: #1915956
I would expect we only do this if custom handling is disabled. Why do we need this magic special case here?
Comment #6
berdirThe first sentence shouldn't be longer than 80 characters.
Missing a description line.
Agree that the way the patch handles that is strange. It is like that because the build submit function copies everything over by default. It is weird because it assumes that $form_state['job'] is *not* the same object as the one returned by the load function which I think is only true because it has been serialized/unserialized.
Instead, we should either get the settings *before* the submit helper function is called and then overwrite it with that or overwrite the method that is called on the UI controller (the function is just a wrapper of that) and handle it there. Actually, we could do both. Copy/overwrite the settings in that method.
Comment #7
blueminds commentedIt looks like we can use job in form state $form_state['tmgmt_job'] instead of loading new one from db.
Not sure though what you mean by "overwrite the method that is called on the UI controller".
Comment #8
berdirSee http://drupalcontrib.org/api/drupal/contributions!entity!includes!entity..., that function is just a wrapper for a function on the ui controller. I think it might make sense to move that logic into that method, then it's part of the "build entity from form state" handling.
Also, the patch still contains the unrelated language items change.
Comment #9
blueminds commentedoki doki, so once more...
Comment #11
berdirChanges look good, but looks like the patch is against your latest patch, not 7.x-1.x
Wouldn't be worth of a re-roll, but I'd write "TRUE if job settings... ".
Comment #12
blueminds commentedHad to rollback to the previous approach. Problem is that EntityDefaultUIController::entityFormSubmitBuildEntity() is called on every submit, including ajax. We want our logic to be triggered only on the job submit. Otherwise we get job settings values "one submit old" on ajax calls.
It is not clean implementation but the only one working that I could come up with.
Comment #13
miro_dietikerPlease look into this.
Comment #14
berdirHm, is this related?
If it needs to be like this, fine.
However, we should then use entity_load_unchanged('tmgmt_job', $job->tjid) to make sure that we have an unchanged entity and not the same object as the one we already have in $job. Should not be the case in most scenarios but doesn't hurt to be sure.
Comment #15
blueminds commented1) It is similar fix as in tmgmt_job_settings_custom_handling() and did not want to create new issue just to fix it.
2) Changed as requested.
Comment #16
berdirThanks, commited.
Comment #17
mfinaly commentedThis is all Greek to me (haha), but does this plugin allow users to add their own vendors for direct translation requests? Right now we have to export a batch of nodes and then send off.
Comment #18
miro_dietikermfinaly - tmgmt allows developers to do so.
This was a technical issue with a clear scope. If you have support questions, please open separate issues.