medusa icon indicating copy to clipboard operation
medusa copied to clipboard

Inconsistent behaviour between product import and admin UI

Open xyzones opened this issue 6 months ago • 1 comments

If a new product violates the unique index of the product handle the database error is displayed

Environment

medusa -v
Medusa CLI version: 1.3.22
Medusa version: 1.20.0
node -v
v20.11.0
postgres=#  SELECT version();
 version                                         
------------------
 PostgreSQL 15.4

Steps to reproduce the behavior

  • create a simple product with no custom title for the variant

    • Product can be saved
  • import via CSV a product that has empty string "" for the Variant Title column

Product Id;Product Handle;Product Title;Variant Title;Variant Inventory Quantity
;no-variant-title;No Variant Title;"";0
  • error is thrown

    Error while processing row with [(product id: null), (product handle: no-variant-title), (variant id: undefined), (variant sku: undefined)]: null value in column "title" of relation "product_variant" violates not-null constraint

    • see #6192

Expected Behaviour

An empty string is not considered null

xyzones avatar Jan 23 '24 16:01 xyzones

I'm having the same issue, did you manage to solve it?

luis-cruzt avatar Mar 15 '24 04:03 luis-cruzt