TMGMTException: The job has no provider assigned

Created on 24 January 2020, almost 5 years ago
Updated 12 June 2024, 5 months ago

Problem/Motivation

When using this module as a TMGMT provider we got the following error each time after requesting a translation on the /admin/tmgmt/jobs/X path:

Drupal\tmgmt\TMGMTException: The job has no provider assigned. in Drupal\tmgmt\Entity\Job->getTranslator() (line 525 of /web/modules/contrib/tmgmt/src/Entity/Job.php).

Somehow the provider is not being set properly, even tho it is selected when submitting the TMGMT job. I looked at other TMGMT providers and saw that as an example lionbridge_translation_provider β†’ is pre-saving the Job in the checkoutSettingsForm() method.

Information

- Drupal Core version: 8.7.11
- PHP version: 7.2.13
- TMGMT version: latest dev version
- Memsource TMGMT version: latest release (1.6)
- Memsource home url: https://cloud.memsource.com/web

Solution

I will provide a patch that does something similar to what lionbridge_translation_provider is doing by pre-saving the Job in the checkoutSettingsForm() method. This fixed the above error.

After solving that error, we had issues with the "project_template" and "due_date" that were not being set in the Job, so I added some guards and also set these in the checkoutSettingsForm() which is now sending these parameters correctly to Memsource.

πŸ› Bug report
Status

Fixed

Version

1.6

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands falco010 πŸ‡³πŸ‡± The Netherlands

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024