- Issue created by @ramesh.tellamekala
- Assigned to shubham_jain
- Issue was unassigned.
- 🇮🇳India shubham_jain
Hi @ramesh.tellamekala, I followed your steps in Drupal 9.5.10 using php 8.1 but was unable to reproduce the error.
See attched screenshot for refrence. This error is thrown under the following circumstances in a multilingual site:
- Site have content translation, moderation enabled.
- User creates a node and sets the language to German.
- User updates the node and set the language to English.
- 🇮🇳India shubham_jain
Hi @ramesh.tellamekala, the screenshots that I shared are of the same node. let me explain you in detail what did I do.
Firstly as you said enabled Content Translation and Content moderation module.
Added German language because English was default.
Enabled ‘Show language selector on create and edit pages’ and ‘Enable translation’ options in article content type ‘Language Settings’.
The ‘Language’ field was visible in ‘Manage form display’ tab of article content type.
Created new field with entity reference version and selected accordian paragraph type.
Created a new article node with selection of ‘German’ in Language field
Edited the same article node and try to select ‘English’ language in ‘Language’ field and saved that node.No Error occoured.
Please correct me if I forgot something.
- last update
about 1 year ago 29,462 pass, 1 fail - last update
about 1 year ago 29,462 pass, 1 fail - Status changed to Needs review
about 1 year ago 11:10am 13 September 2023 - Status changed to Needs work
about 1 year ago 4:11pm 13 September 2023 - 🇺🇸United States smustgrave
Have not reviewed.
As a bug will need a test case showing the issue. Updated remaining tasks
Also proposed solution sounds like more "expected results" but not mentioning how the solution will be achieved.
- 🇨🇳China eason xu
1: Upload an image in media.
2: Reference this image in a paragraph.
3: Reference this paragraph to a node.
4: Access the usage list of image.
Result: Report an error. InvalidArgumentException: Invalid translation language (en) specified. in Drupal\Core\Entity\ContentEntityBase->getTranslation() (line 874 of /mnt/www/html/terumo01live/docroot/core/lib/Drupal/Core/Entity/ContentEntityBase.php).
This patch helped me solve this error. - 🇪🇸Spain rcodina Barcelona
Patch on #6 fixes the error for me on Drupal 10.1.6.
- First commit to issue fork.
- 🇻🇳Vietnam phannphong Ho Chi Minh City
I faced exactly the issue here and the patch #6 fixes the error on Drupal 10.1.6.
- 🇨🇭Switzerland handkerchief
Same issue, same solution, patch #6 works for me for Drupal 10.2.2.
- 🇮🇳India pooja saraah Chennai
Added Condition for Active Language Check:
The elseif condition checks if there is no translation object for the switched language used by the language field in the entity ($this->activeLangcode) and if the requested language ($langcode) is different.
If this condition is met, it initializes the translation using the default active translation.
Attached modified patch. - last update
10 months ago Composer error. Unable to continue. - 🇬🇷Greece bserem
None of the provided patches work for me. In my case I am trying to add translations to blocks using Drupal 10.2
- 🇷🇸Serbia levmyshkin Novi Sad, Serbia
I also had the problem with blocks translation, but this helped me #2137815:
https://www.drupal.org/project/drupal/issues/2137815 🐛 InvalidArgumentException: Invalid translation language specified. Needs work - last update
7 months ago Custom Commands Failed