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

defaultValue won't be applied for customFields #3266

Open
KilianSSL opened this issue Dec 9, 2024 · 0 comments
Open

defaultValue won't be applied for customFields #3266

KilianSSL opened this issue Dec 9, 2024 · 0 comments
Labels
type: bug 🐛 Something isn't working

Comments

@KilianSSL
Copy link

Describe the bug
When i define a defaultValue for a custom field of type string on the Product entity, it always ends up being null in the database. For type int it always ends up being 0, despite of what i set in the config, e.g. 101.

To Reproduce
Steps to reproduce the behavior:

  1. Add custom field (type "string", with a desired defaultValue) in the vendure config, for entity Product
  2. Apply migrations
  3. Navigate to "Product"
  4. Fill out required fields, already note that there is no value visible in the newly added custom field.
  5. Click "Create"
  6. In the network tab, the value for the custom field is null
  7. If you check the database, the value is null as well.

Expected behavior
Default values behave as intended.

Environment (please complete the following information):

  • @vendure/core version: 3.1.0
  • Nodejs version 20.17.0
  • Database (mysql/postgres etc): sqlite

Additional context
Reproduction: https://github.com/KilianSSL/vendure-custom-field-default-value

@KilianSSL KilianSSL added the type: bug 🐛 Something isn't working label Dec 9, 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
None yet
Development

No branches or pull requests

1 participant