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

Admin : translated status causes product publishing errors for non-english #5388

Closed
bqst opened this issue Oct 17, 2023 · 2 comments · Fixed by #5394
Closed

Admin : translated status causes product publishing errors for non-english #5388

bqst opened this issue Oct 17, 2023 · 2 comments · Fixed by #5394

Comments

@bqst
Copy link
Contributor

bqst commented Oct 17, 2023

Bug report

Describe the bug

When the user's language setting is set to a language other than English (in this case, French), it becomes impossible to publish/unpublish a product from the admin panel. An error message appears stating: "Erreur: status must be one of the following values: draft, proposed, published, rejected."

System information

Medusa version (including plugins):

    "@medusajs/admin": "^7.1.4",
    "@medusajs/cache-inmemory": "^1.8.7",
    "@medusajs/cache-redis": "^1.8.7",
    "@medusajs/event-bus-local": "^1.9.6",
    "@medusajs/event-bus-redis": "^1.8.9",
    "@medusajs/file-local": "^1.0.2",
    "@medusajs/inventory": "^1.10.0",
    "@medusajs/medusa": "^1.17.1",
    "@medusajs/stock-location": "^1.10.0",
    "@medusajs/ui": "^2.2.0",
    "medusa-file-minio": "^1.3.0",
    "medusa-fulfillment-manual": "^1.1.37",
    "medusa-interfaces": "^1.3.7",
    "medusa-payment-manual": "^1.0.23",
    "medusa-payment-paypal": "^6.0.2",
    "medusa-payment-stripe": "^6.0.3",
    "medusa-plugin-algolia": "^0.2.20",

Node.js version: 18
Database: pg

Steps to reproduce the behavior

  1. Go to the admin panel
  2. Set the user's language to French
  3. Attempt to publish or unpublish a product
  4. See error message

Expected behavior

I expect to be able to publish or unpublish a product regardless of the user's language setting.

Additional context

It seems like the language setting is affecting the validation for product statuses, possibly due to localization issues. This is limiting the usability for non-English speaking users.

Additionally, upon inspecting the network traffic, it's evident that the POST request payload is sending the translated status. For instance, sending "{status: "Brouillon"}" instead of the expected enum values like "draft". This might be the root cause of the issue.

@bqst bqst changed the title Admin Panem : Translated status causes product publishing errors for non-english Admin : translated status causes product publishing errors for non-english Oct 17, 2023
@olivermrbl
Copy link
Contributor

olivermrbl commented Oct 17, 2023

Hmm, this is strange. I can't seem to reproduce the error. See video attached below:

CleanShot.2023-10-17.at.13.25.59.mp4

Also, in the implementation, we are specifically using either "draft" or "published" regardless of the product status translation:

const newStatus = currentStatus === "published" ? "draft" : "published"

Can you confirm, that we are attempting to update the product status in the same place?

@olivermrbl
Copy link
Contributor

olivermrbl commented Oct 17, 2023

I found the issue. You can't update status through the list overview. Thanks for filing the issue!

We will fix this right away and include it in this week's release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants