Skip to content

[BUG]: Component relations inside dynamic zone disappear when translating from content manager #315

@gaspop

Description

@gaspop

Describe the bug
If a collection/single type has a dynamic zone, and a component inside that zone has a relation to another collection type/entity, this relation is reset when using "translate from another locale" inside the content manager and saving.

To Reproduce
Steps to reproduce the behavior:

  1. In the content-type builder, Create a collection type called "Type A"
  2. Create a component called "Block", with a field relation to "Type A"
  3. Create another collection type called "Type B" with a dynamic zone, where you can add the "Block" component.
  4. In settings, under internationalization, add a second locale if there isn't one
  5. In the content manager, create an instance of "Type A", translate this instance to another locale.
  6. Create an instance of Type B, add a "Block" component to its dynamic zone and set the relation to the instance of "Type A"
  7. Open the new instance of Type B in the second locale, then press "Translate from another locale" and select the first locale.
  8. Before saving, look at the component inside the dynamic zone, it should show a relation to the translated instance of "Type A".
  9. Save, leave the translated instance and return, look at the component inside the dynamic zone again. The relation is gone.

Expected behavior
When pressing save after selecting "translate from another locale", relations in components in dynamic zones should not be lost.

Screenshots
N/A

System (please complete the following information):

  • OS: MacOS Ventura 13.4.1
  • Browser Chrome
  • Versions:
    • strapi: 4.12.7
    • strapi-plugin-translate: 1.2.2
    • provider: strapi-provider-translate-deepl@1.1.9
  • Other Strapi plugins:
    • @strapi/plugin-graphql@4.12.7
    • @strapi/plugin-i18n@4.12.7
    • @strapi/plugin-users-permissions@4.12.7
    • strapi-plugin-responsive-image@1.1.0

Plugin config
Please add your plugin config here, e.g.

module.exports = {
  translate: {
    enabled: true,
    config: {
      provider: 'deepl',
    },
  },
}

Additional context
It looks as if the relation is still there after translating, but it isn't kept when saving. The problem only occurs when translating in the content manager, not when batch translating.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Investigate

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions