diff --git a/translators/tmgmt_local/tmgmt_local.module b/translators/tmgmt_local/tmgmt_local.module index 847cd23..031c55f 100644 --- a/translators/tmgmt_local/tmgmt_local.module +++ b/translators/tmgmt_local/tmgmt_local.module @@ -592,7 +592,7 @@ function tmgmt_local_get_translators_for_tasks($tasks) { return array_shift($translators); } - return $translators; + return array(); } /** @@ -857,7 +857,6 @@ function tmgmt_local_capabilities($source_language = NULL, $target_language = NU // If authenticated user is has the required permission we do not have to do // the role check. if (!in_array('authenticated user', $roles)) { - $query->leftJoin('users_roles', 'ur', 'ur.uid = u.uid'); $query->leftJoin('users_roles', 'ur', "ur.uid = u.uid AND ur.rid IN (:roles)", array(':roles' => implode(', ', array_keys($roles)))); } diff --git a/translators/tmgmt_local/tmgmt_local.test b/translators/tmgmt_local/tmgmt_local.test index 17cfe4f..9723fe5 100644 --- a/translators/tmgmt_local/tmgmt_local.test +++ b/translators/tmgmt_local/tmgmt_local.test @@ -159,6 +159,9 @@ class TMGMTLocalTestCase extends TMGMTBaseTestCase { $job->addItem('test_source', 'test', '1'); $job->addItem('test_source', 'test', '2'); + $this->drupalGet('admin/tmgmt/jobs/' . $job->tjid); + $this->assertText(t('@translator can not translate from @source to @target.', array('@translator' => 'Local Translator (auto created)', '@source' => 'English', '@target' => 'German'))); + // Create another local translator with the required capabilities. $other_translator_same = $this->drupalCreateUser($this->local_translator_permissions); $this->drupalLogin($other_translator_same);