When you programmatically create a paragraph with language "Not applicable" the entity edit form throws following error:

InvalidArgumentException: The entity cannot be translated since it is language neutral (zxx)

This seems to happen because paragraphs assumes entities are always language-specific and automatically creates new translations:

if ($paragraphs_entity->hasField('content_translation_source')) {
  // Initialise the translation with source language values.
  $paragraphs_entity->addTranslation($langcode, $paragraphs_entity->toArray());
  // ...
}

Issue fork paragraphs-3344291

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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Matthijs created an issue. See original summary.

Matthijs’s picture

Status: Active » Needs review