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 fields localeText with Relation breaks update #2708

Closed
drobytskyi opened this issue Feb 28, 2024 · 1 comment
Closed

Custom fields localeText with Relation breaks update #2708

drobytskyi opened this issue Feb 28, 2024 · 1 comment
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@drobytskyi
Copy link

Describe the bug
I want to add custom fields to Product, here is the code, which I'm adding:

vendure-config.ts

To Reproduce
Steps to reproduce the behavior:

customFields: {
    Product: [
      {
        name: "alternatives",
        list: true,
        type: "relation",
        entity: Product,
        label: [
          {
            languageCode: LanguageCode.en,
            value: "Alternative Variants",
          },
        ],
        nullable: true,
      },
      {
        name: "composition",
        type: "localeText",
        nullable: true,
        list: false
      },
      {
        name: "washing",
        type: "localeText",
        nullable: true,
        list: false
      },
      {
        name: "modelSize",
        list:false,
        nullable: true,
        type: "relation",
        entity: Asset,
        label: [
          {
            languageCode: LanguageCode.en,
            value: "Model & Size",
          },
        ],
      },
    ],
  },

Getting Error

[server] error 2/28/24, 2:35 AM - [ExceptionsHandler] Cannot set properties of undefined (setting 'alternatives')
[server] TypeError: Cannot set properties of undefined (setting 'alternatives')

Expected behavior

Updating fields in the admin UI

Environment (please complete the following information):

  • @vendure/core version: 2.1.7
  • Nodejs version: 20
  • Database (mysql/postgres etc): postgres

Additional context
Add any other context about the problem here.

@drobytskyi drobytskyi added the type: bug 🐛 Something isn't working label Feb 28, 2024
@brmk
Copy link

brmk commented Feb 28, 2024

maybe a duplicate of #2680 ?

@michaelbromley michaelbromley moved this to 🏗 In progress in Vendure OS Roadmap Mar 4, 2024
@michaelbromley michaelbromley moved this from 🏗 In progress to 🔖 Ready in Vendure OS Roadmap Mar 4, 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

No branches or pull requests

3 participants