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
Issue fork tmgmt_deepl-3575730
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
Comment #2
steffenrCan 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
Comment #3
steffenrComment #4
grimreaperHi,
Thanks for the quick reply.
I am using the 2.3.0-alpha6 version so I have the fix.
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.
Comment #7
steffenr@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.
Comment #8
grimreaperThanks, I will retry in a month as I have reached my API usage limit.
Comment #9
grimreaperI have not forgotten this issue.
Just reached my API usage limit again after translating like 20 articles on my production website...
Comment #10
grimreaperHi,
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.
Comment #11
steffenr@grimreaper: Thanks for keeping me updated on the issue. I'll mark the issue as fixed.
Comment #13
grimreaperThanks, don't forget to give a look at https://new.drupal.org/contribution-record/11443435 :)
Comment #14
steffenr@grimreaper I've resaved the contribution record. Hope it appears in your profile soon.
Comment #15
grimreaperI confirm that.
Thanks!