Skip to content

[Content Manager][i18n] Duplicate translated entity keep relation with duplicated entity #20091

@Slashgear

Description

@Slashgear

Bug report

Required System information

  • Node.js version: 20.11
  • Yarn version: 3.8.1
  • Strapi version: 2.21.0
  • Database: postgres 13.3
  • Operating system: Macos 14.3.1
  • Is your project Javascript or Typescript: Javascript

Describe the bug

Duplication of an entity in the content manager with entity using i18n plugin activated will have a strange behaviour of keep the relation to cloned entity.

sequenceDiagram
    actor User as User
    User->>+StrapiAdmin: Click on duplicate button
    StrapiAdmin->>Controller: Forge a http query to the collection-types.ts `autoClone` method
    Controller->>EntityManager: Call entity manager clone method
    EntityManager->>Controller: Return new entity with `localization` object copied from cloned one
    Controller->>StrapiAdmin: Show a translation alternative in the cloned entity
    StrapiAdmin->>User: Don't permit user to contribute be able to create an alternative language of his entity as it already exist
Loading

Steps to reproduce the behavior

  1. Go to content manager
  2. Open entity which has i18n activated
  3. Click on duplicate/clone button in ListEntity
  4. Clone entity has a link to the cloned entity translations

Expected behavior

A clear and concise description of what you expected to happen.

  • 💡 Ignore automatically localization relation during the cloning process in the entity manager

Screenshots

If applicable, add screenshots to help explain your problem.

Screen.Recording.2024-04-11.at.15.14.44.mov

Code snippets

If applicable, add code samples to help explain your problem.

Additional context

Add any other context about the problem here.

  • @strapi/plugin-i18n 4.21.1

Metadata

Metadata

Labels

issue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: core:content-managerSource is core/content-manager packagestatus: pending reproductionWaiting for free time to reproduce the issue, or more informationversion: 4Issue is present in Strapi v4

Type

No type

Projects

Status

To be reviewed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions