Problem/Motivation
In #1420364: A simple response object for methods which need to return a true/false *and* a message an object called Available Result and Translatable result were added. Instead of simple boolean values, this objects also contain a message in case the Response is false.
When the Simple Response class is added to TMGMT, the plugins will have to be updated to work with TMGMT again.
Methods which need to return the new object (from the TranslatorPluginInterface):
- public function checkAvailable(TranslatorInterface $translator);
- public function checkTranslatable(TranslatorInterface $translator, JobInterface $job);
Both will return AvailableResult and TranslatableResult.
Proposed resolution
Update the plugin so it works with TMGMT again.
Remaining tasks
Do it, review, commit.
User interface changes
None
API changes
checkAvailable() and checkTranslatable will return a Response object instead of a simple boolean. The AvailableResult/TranslatableResult have an error message in case the Response is false.
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | Simple_response_microsoft-2545374-9.patch | 2.57 KB | juanse254 |
| #9 | interdiff-2545374-6-9.txt | 1.51 KB | juanse254 |
| #6 | interdiff-2545374-5-6.txt | 754 bytes | juanse254 |
| #6 | Simple_response_microsoft-2545374-6.patch | 2.11 KB | juanse254 |
| #5 | interdiff-2545374-3-5.txt | 845 bytes | juanse254 |
Comments
Comment #1
LKS90 commentedComment #2
juanse254 commentedComment #3
juanse254 commentedComment #4
berdir:placeholders are for URLs, not for links.
Comment #5
juanse254 commentedYes right, fixed.
Comment #6
juanse254 commentedOops, this is the right one.
Comment #7
sasanikolic commentedLooks ok.
Comment #8
berdirThat logic is not correct. The parent doesn't return true/false anymore. Instead, you want to check if the parent returns a unsucessful result and if yes, return that.
Or, if easier, just check the length and then call the parent if that is ok.
And the length check needs to return an actually useful message now, that explains what the problem is.
Comment #9
juanse254 commentedComment #10
juanse254 commentedComment #11
berdirYeah, still some room on improving the error message, but this is better than before. Committed.