Problem/Motivation

I tried to submit a cart with like 240 medias to translate from french to english.

Then I got the following batch error:

Got error 'PHP message: Uncaught PHP Exception TypeError: "Drupal\\tmgmt_deepl\\DeeplTranslatorBatch::decodeAndUnescapeText(): Argument #3 ($translated_text) must be of type DeepL\\TextResult, null given, called in PATH/app/modules/contrib/tmgmt_deepl/src/DeeplTranslatorBatch.php on line 315" at PATH/app/modules/contrib/tmgmt_deepl/src/DeeplTranslatorBatch.php line 189', referer: https://SITE/batch?id=147&op=start

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

grimreaper created an issue. See original summary.

steffenr’s picture

Can you provide Step to reproduce?
Where did you select the media entities for translation?

Some month ago, i fixed an issue within bulk translations: https://www.drupal.org/project/tmgmt_deepl/issues/3542894

steffenr’s picture

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

Assigned: Unassigned » grimreaper
Status: Postponed (maintainer needs more info) » Active

Hi,

Thanks for the quick reply.

I am using the 2.3.0-alpha6 version so I have the fix.

  1. On admin/tmgmt/sources, I have added untranslated media to the cart
  2. Then on /admin/tmgmt/cart, I sent all 240 medias to be translated from french to english

I have reached my DeepL API usage limit for this month as I have enabled multilingual on my website this week, so I have to translate every thing. I did only few tests on dev environment and got the error on prod when trying to translate everything.

I will try to reproduce locally next month locally.

  • steffenr committed 4c72e202 on 2.3.x
    fix: #3575730: Batch error null given instead of TextResult
    
steffenr’s picture

@grimreaper:
I tried reproducing the error with a simple media type with an image field and a title field. While selecting multiple sources/ adding those to cart, it was working fine for me.
But to ensure, we won't get the error I've updated the 2.3.x branch and added an addtional check, that ensures we get a non-null argument.

grimreaper’s picture

Thanks, I will retry in a month as I have reached my API usage limit.

grimreaper’s picture

I have not forgotten this issue.

Just reached my API usage limit again after translating like 20 articles on my production website...

grimreaper’s picture

Assigned: grimreaper » Unassigned

Hi,

I finally got the time and the token to test for this issue.

Tested with 2.3.0-alpha8, submitting a huge amount of content to translate, now I properly got the batch error message: "Quota for this billing period has been exceeded, message: Quota Exceeded" and the batch finishes.

So I think the commited change fixed the issue.

I let you mark the issue as fixed.

steffenr’s picture

Status: Active » Fixed

@grimreaper: Thanks for keeping me updated on the issue. I'll mark the issue as fixed.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

grimreaper’s picture

Thanks, don't forget to give a look at https://new.drupal.org/contribution-record/11443435 :)

steffenr’s picture

@grimreaper I've resaved the contribution record. Hope it appears in your profile soon.

grimreaper’s picture

I confirm that.

Thanks!