Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
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 #3
Matthijs