Closed (fixed)
Project:
Translation Management Tool
Version:
7.x-1.x-dev
Component:
Core
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
13 Feb 2013 at 17:20 UTC
Updated:
1 Mar 2013 at 08:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
berdirComment #3
berdirThis is currently by design. It arguably might be bad design but it can't be changed that easily. If you don't pass a plugin name in then you get a list of all controllers.
I don't like it either, but it's neither a bug nor critical. If we want to improve it then probably in the wrapper functions.
Comment #4
cgalli commentedMiro posted the (two) issues under my name. The current setup leads to fatal errors when using the DS connector plugin.
I do assume that we will have to work around them in the plugin then.
Comment #5
miro_dietikerThis was related to
#1916422: translator name is missing when creating new translator
Note that during the ajax call, in the referred issue, the $controller was array instead of the object itself (although the loading name was empty, i guess).
So the return type was different and that resulted in fatal error (calling function on non-object).
If we stay that way, we'll need to make sure all occurences of loading guarantee to contain a valid string
Note that this is - in combination with our translator form settings creation, and the combination with possible ajax actions on that form, really bad design - as most translator implementations risk to create fatal errors... that are currently uncovered by tests (and really hard to cover).
Comment #6
blueminds commentedSee attached patch.
In case the translator does not exists, we should not provide the mapping feature anyway. Also I updated docs for tmgmt_translator_plugin_controller() as before it clearly stated that it returns only the translator plugin object. Based on this I implemented the faulty logic.
Comment #7
miro_dietikerBy specification, the bug is not that tmgmt_translator_plugin_controller returns an array, but much more that it expects a translator name while here $translator->name is empty. So we should avoid this call in this case.
Finally the following is the real problem, as by your patch above, all new translators will end up with disabled language mappings.
Update the function that checks if language mappings should happen to follow the plugin controller info instead of the instance settings.
map_remote_languages should never end in settings of a translator.
Please also make a difference in written text between translator (instances) and the plugins.
Comment #8
blueminds commentedPlease see the patch
Comment #10
miro_dietikerIn my opinion, map_remote_languages is no setting. It should be read from the plugin_info directly.
Comment #11
blueminds commentedPlease see the patch
Comment #13
miro_dietikerMuch better. Please fix the test fails and then let's pass to Berdir to finally commit.
Comment #14
blueminds commentedPlease see the patch
Comment #15
miro_dietikerCommitted, attributed to blueminds, pushed.