Error editing content with undefined language, add check

Created on 29 March 2022, about 2 years ago
Updated 8 April 2024, 3 months ago

Problem/Motivation

I am receiving an error when editing content that has no language defined e.g:

InvalidArgumentException: Invalid translation language (und) specified. in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 956 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

Invalid translation language (und) specified.

Proposed resolution

Add check with isTranslatable() in entity_reference_revisions_entity_revision_create to make sure content is translatable before calling translate methods

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada pub497

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

Merge Requests

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.69.0 2024