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

fix: saving single variant attribute from product page #2151

Open
wants to merge 4 commits into
base: 1.x
Choose a base branch
from

Conversation

fredmarmillod
Copy link
Contributor

This PR fixes an issue with single variant product attribute saving when attribute types are not Text or Translatable Text.

#1996 (comment)

Steps to reproduce:

  1. Install Lunar starterkit
  2. Create a attribute group
  3. Add a Number field to the group
  4. Add the group to a product type
  5. Create a new product
  6. Try to save the product

Expected behavior:

The product should save successfully.

Actual behavior:

It triggers a validation error.

Copy link

vercel bot commented Mar 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2025 1:21pm

@alecritson
Copy link
Collaborator

Hi @fredmarmillod Thanks for this, unfortunately it doesn't seem to fix the issue for me. I still get the validation error, which I agree is a problem 🤔

@fredmarmillod
Copy link
Contributor Author

You're right, I've retried and it works only if the product type only has variant attributes configured. When we add product attributes, it triggers a validation error only for those. It seems like there is a conflict with the attribute_data state path.

@fredmarmillod
Copy link
Contributor Author

@alecritson The changes appear to be working correctly now. Could you please review the implementation and let me know if you notice any potential issues?

@fredmarmillod fredmarmillod marked this pull request as ready for review April 1, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants