This was reported by a customer. I went step-by-step with him over the phone.
The issue is that when removing the "sandbox" checkbox (and putting the production API keys), the module does not allow to translate the node with OHT.

How we reproduced this problem:
1. Enter "sandbox API keys" on the module settings
2. Select "Sandbox" checkbox
3. Submit a node for translation -> the node is submitted and translation is returned. Everything OK.
4. Uncheck "sandbox" checkbox and enter production API keys
5. Unable to submit any node for translation.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

miro_dietiker’s picture

Status: Active » Postponed (maintainer needs more info)

We need language setups (keys) and language mapping definitions, and especially the node source language and target language as such as possibly other checkout settings that are in place.

oyagev’s picture

FileSize
139.95 KB
93.18 KB

Hi
I took some screenshots, hope this helps...

oyagev’s picture

Status: Postponed (maintainer needs more info) » Active
oyagev’s picture

Found a problem in "canTranslate" function
Please see patch

oyagev’s picture

Status: Active » Closed (fixed)
Berdir’s picture

Status: Closed (fixed) » Needs review
Berdir’s picture

+++ b/tmgmt_oht.plugin.inc
@@ -109,9 +109,9 @@ class TMGMTOhtPluginController extends TMGMTDefaultTranslatorPluginController {
     if ($this->isAvailable($translator)) {
-      $targets = $this->getSupportedRemoteLanguages($translator);
-      return isset($targets[$this->mapToRemoteLanguage($translator, $job->source_language)]) &&
-        isset($targets[$this->mapToRemoteLanguage($translator, $job->target_language)]);
+        $targets = $this->getSupportedRemoteLanguages($translator);
+        return in_array($this->mapToRemoteLanguage($translator, $job->source_language), $targets) &&
+            in_array($this->mapToRemoteLanguage($translator, $job->target_language), $targets);
     }

Fix looks correct, but you accidently changed the indentation to 4 spaces instead of 2 for those lines.

If you have time to upload a patch with that fixed, I'll commit it asap. Otherwise I'll get to it in the next few days.

oyagev’s picture

Sure
Although time was of the essence, I already committed and customer already tested and approved.
Here's a patch that fixes the indentation.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Ah right, I forgot that you have commit access too.

Looks like your e-mail isn't set up correctly, though. See https://drupal.org/node/1612398/commits, your commit isn't linked to your username and therefore also doesn't show up in the recent commits block on the project. Make sure that the e-mail address that is configured in your git client matches one of the e-mails that you've set up on drupal.org (you can add multiple ones in your profile).

oyagev’s picture

Yes I noticed that too.
Already fixed.

Should I commit the new fix (indentation) ?

Berdir’s picture

Yes, go ahead :)

oyagev’s picture

Status: Reviewed & tested by the community » Closed (fixed)

pushed