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

Unable to Publish Single Type in Non-Default Locale if It's Not Created in Default Locale #20188

Open
hiba-ijjig-nw opened this issue Apr 23, 2024 · 2 comments
Assignees
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: plugin:i18n Source is plugin/i18n package status: pending reproduction Waiting for free time to reproduce the issue, or more information

Comments

@hiba-ijjig-nw
Copy link

Required System Information

  • Node.js version: v20
  • Yarn version: v3.1.1
  • Strapi version: v4.20.0
  • Database: Postgres
  • Operating System: Windows
  • Project Language: Typescript

Describe the Bug

A user cannot publish a single type in a specific locale if that single type hasn't been created in the default locale, or if the user lacks access to the default locale.

Steps to Reproduce

  1. Create a new single type.
  2. Fill out and save the content in this non-default locale.
  3. Try to publish the single type.

Expected Behavior

The user should be able to publish a single type in a specific locale, even if it's not created in the default locale, or if the user lacks access to the default locale.

Screenshots

In this example, fr-FR is the default locale.
image

  1. Creating a single type and attempting to publish it in en-FR:
    image

publishing the single type gives a countDraftRelations error with a status code of 404 because it hasn't been created in the default locale (fr-FR).

  1. If the single type is created in the default locale but the user lacks access to it:
    image
    In this case, countDraftRelations failed with a 403 because the user didn't have access to the default locale.

I belive that these errors occur because countDraftRelations checks the default locale instead of the current one.

@alexandermirzoyan
Copy link

Same issue for me.
I have investigated that somehow when saving Content with non-default language in db it stores with default locale.
That's why during publish the system can't find non-default content from db.

@alexandermirzoyan
Copy link

Seems this issue is about the same thing.

@joshuaellis joshuaellis added issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around status: pending reproduction Waiting for free time to reproduce the issue, or more information source: plugin:i18n Source is plugin/i18n package labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: plugin:i18n Source is plugin/i18n package status: pending reproduction Waiting for free time to reproduce the issue, or more information
Projects
Status: To review
Development

No branches or pull requests

4 participants