Not possible to configure multiple Lionbridge providers

Created on 14 March 2023, over 1 year ago
Updated 23 May 2023, over 1 year ago

Problem/Motivation

We are trying to configure an additional Lionbridge provider in order for our editors to submit translation jobs that uses a different workflow. But we've run into several issues trying to configure an additional provider.

For example, in \Drupal\tmgmt_contentapi\ContentApiTranslatorUI::buildConfigurationForm only the default provider config (that gets installed when you install the module) is loaded and updated, instead of the configuration entity the form is actually loading.

$tmpSettings = \Drupal::service('config.factory')->getEditable('tmgmt.translator.contentapi');

// A little bit further down in the same method...
$prevHost = $tmpSettings->get('settings.capi-settings.capi_host');
$tmpSettings->set('settings.capi-settings.capi_host',$capisettings["capi_host"]);
$tmpSettings->save();

This also means that if you'd remove the default provider and create a new one, the module would be totally broken.

Steps to reproduce

- Create an additional Lionbridge translation provider that uses a different lionbridge provider and/or host (we encountered this issue when configuring one provider that connected to the

contentapi.lionbridge.com/v2

and the other connected to

content-api.staging.lionbridge.com/v2

.
- Create a new translation job and change translation provider to the custom one

Proposed resolution

Find all instances were we assume a tmgmt.translator.contentapi config entity exists and load the config from context instead.

For example instead of $tmpSettings = \Drupal::service('config.factory')->getEditable('tmgmt.translator.contentapi'); do $tmpSettings = $form_state->getFormObject()->getEntity();.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: won't fix

Version

2.0

Component

Code

Created by

πŸ‡ΈπŸ‡ͺSweden marcusml

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @marcusml
  • Status changed to Closed: won't fix over 1 year ago
  • πŸ‡΅πŸ‡±Poland Juan.OrtizMenchaca

    This is as designed. The connector is not meant to support multiple Drupal Lionbridge Providers on the same instance. Instead, the Lionbridge provider offers a list of Lionbridge Translation Providers, within the same configured Drupal Lionbridge Provider. Also, the connector is not designed to offer dual staging and production connectivity. This is also per design, to avoid mixing up experimental translations, that don't incur in costs, and production translations which incurs in costs

Production build 0.71.5 2024