Skip to content
Snippets Groups Projects
Commit 6191689b authored by Shoaib's avatar Shoaib
Browse files

Issue #3410169: Order of parameters is wrong

parent f22ece86
No related branches found
No related tags found
1 merge request!11Issue #3410169: Order of parameters is wrong
......@@ -96,8 +96,8 @@ class AzureTranslate {
}
if ($fromLanguage != $toLanguage) {
try {
$endpoint = $endpoint ? $endpoint : $this->config->get('endpoint');
$api_key = $api_key ? $api_key : $this->credentials->getApikey();
$endpoint = !empty($endpoint) ? $endpoint : $this->config->get('endpoint');
$api_key = !empty($api_key) ? $api_key : $this->credentials->getApikey();
$params = "to=" . $toLanguage . "&from=" . $fromLanguage;
$translateUrl = Xss::filter($endpoint) . "&" . $params;
......
......@@ -168,7 +168,7 @@ class AutoAlterTranslateSettingsForm extends ConfigFormBase {
$api_key = $credentials->getApikey();
if ($active) {
$request = $this->azuretranslate->gettranslation('Please translate this text', $endpoint, $api_key, $region, "en", "de");
$request = $this->azuretranslate->gettranslation('Please translate this text', $region, $endpoint, $api_key, "en", "de");
if (isset($request) && $request !== FALSE && $request->getStatusCode() == 200) {
\Drupal::messenger()->addStatus($this->t('Your settings have been successfully validated'));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment