Problem with translate additional block

Created on 18 January 2024, 10 months ago
Updated 5 February 2024, 10 months ago

Problem/Motivation

I have a problem with adding translation to block_content basic block.
My default lang is english and if I create new Content Block -> Basic block in english version everything is ok but later if I try translate this then I get error like bellow.

nvalidArgumentException: Invalid translation language (pl) specified. in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 989 of /var/www/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).

It only doesn't work for Content Block. Rest of entities like nodes, paragraphs, media works as expected. I also turn on the option Enable translation.

I noticed that this conditional

<?php
 if (!isset($this->languages[$langcode]) || $this->hasTranslation($langcode) || $this->languages[$langcode]->isLocked()) {
      throw new \InvalidArgumentException("Invalid translation language ($langcode) specified.");
    }
?>

in ContentEntityBase::addTranslation , second condition $this->hasTranslation($langcode) is true, but should not be true because there is no translation for this version yet.

πŸ› Bug report
Status

Closed: duplicate

Version

10.2 ✨

Component
Content translationΒ  β†’

Last updated about 17 hours ago

No maintainer
Created by

πŸ‡΅πŸ‡±Poland crafter

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

Comments & Activities

Production build 0.71.5 2024