Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicating entry with i18n enabled when not in the default locale created an inconsistent state #19798

Closed
ls-ramos opened this issue Mar 15, 2024 · 2 comments
Labels
status: duplicate Is a duplicate of another issue

Comments

@ls-ramos
Copy link

Bug report

Required System information

  • Node.js version: 20.11.0
  • NPM version: 10.2.4
  • YARN version: 1.22.21
  • Strapi version: 4.20.5
  • Database: SQLite
  • Operating system: darwin-arm64
  • Is your project Javascript or Typescript: TS

Describe the bug

Duplicating an entry that has a locale that is not the default locale, creates an entry on the default locale, but it displays the incorrect locale while creating it.

As an example: You have an entry with locale DE on the content type Test, you click the duplicate button, you go to the page of the newly created entry, and you are shown on the frontend the locale DE, even though the entry is actually on locale EN. Switching the locales fixed the inconsistence situation.

This is very confusion for non-technical people that might be handling strapi.

Steps to reproduce the behavior

Here is a video of the situation:

strapi-i18n-bug2.mp4
  1. Go to an entry in a locale that is not the default, for example DE.
  2. Click on the duplicate button
  3. You will see a screen with the data duplicated and the locale shown will be the one you were in, for example DE. But the entry is actually created in the default locale, for example EN.
  4. If before you save you go back and forth on the locales, meaning you switch to the default locale (for example EN) and then back to the previous locale (for example DE), then you will be in a consistent state where the locale shown is the actual locale where the duplicated entry was created.

Expected behavior

I know that strapi does not currently support duplicating an entry that is not in default locale, there is a feature request for this: https://feedback.strapi.io/customization/p/duplicate-item-does-not-copy-translations

But even though this is not supported, it is expected that the fronted displays consistent information. So following the setup of the video with EN as the default locale and DE an additional locale:

  1. When I am in an entry on the DE locale and I click in duplicate
  2. I expect to at least end up in a newly created entry that is shown to be in the EN locale right away.
    3.So I can bring the data to DE locale if I wish, and remove it from the EN locale if I don't want it there.

Additional context

I believe this is related to others i18n issue, for example to the comment I left on this bug: #18550 (comment)

@philipschikora
Copy link

can confirm

@derrickmehaffy derrickmehaffy added the status: duplicate Is a duplicate of another issue label Mar 28, 2024
@derrickmehaffy
Copy link
Member

Not a complete duplicate of #17498 but most likely caused by the same issue which is lacking the local query parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate Is a duplicate of another issue
Projects
Status: Done
Development

No branches or pull requests

3 participants