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

Custom field with entity ProductVariant throws Cannot set properties of null (setting 'taxCategory') when value is empty #2723

Closed
andriinuts opened this issue Mar 8, 2024 · 0 comments · Fixed by #2727
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@andriinuts
Copy link
Contributor

andriinuts commented Mar 8, 2024

Describe the bug
When you are adding a custom field as ProductVariant entity it throws an error ``Cannot set properties of null (setting 'taxCategory')` when you are leaving this value empty (for example when creating a new order line).

config.customFields.OrderLine.push({ name: 'relatedVariant', type: 'relation', entity: ProductVariant, });

To Reproduce
Steps to reproduce the behavior:

  1. Go to the new draft order and add a new item without selecting relatedVariant value
  2. Click Add item to order
  3. See error

Expected behavior
I would expect that we will not receive this error because the field it not required in the configuration and it should be possible to skip it.

Environment (please complete the following information):

  • @vendure/core version: 2.1.8
  • Nodejs version: v20.10
  • Database (mysql/postgres etc): any
@andriinuts andriinuts added the type: bug 🐛 Something isn't working label Mar 8, 2024
@andriinuts andriinuts changed the title ProductVariant custom field throws Cannot set properties of null (setting 'taxCategory') when value is empty Custom field with entity ProductVariant throws Cannot set properties of null (setting 'taxCategory') when value is empty Mar 8, 2024
@michaelbromley michaelbromley moved this to 📋 Backlog in Vendure OS Roadmap Mar 8, 2024
@michaelbromley michaelbromley moved this from 📋 Backlog to 🔖 Ready in Vendure OS Roadmap Mar 18, 2024
@michaelbromley michaelbromley moved this from 🔖 Ready to ✅ Done in Vendure OS Roadmap Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
Status: 🚀 Shipped
Development

Successfully merging a pull request may close this issue.

2 participants