strapi / strapi

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.
https://strapi.io
Other
60.66k stars 7.58k forks source link

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

Open hiba-ijjig-nw opened 3 weeks ago

hiba-ijjig-nw commented 3 weeks ago

Required System Information

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 commented 2 weeks ago

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 commented 2 weeks ago

Seems this issue is about the same thing.