When I try to add taxonomy term to multiplie products I have problem "This SKU is already in use and must be unique. Please supply another value". The conditions in which this problem appears: for the fresh installation of commerce kickstart 2.9 with sample content go to content types - shoes - category field and change settings for unlimited number of values. Then go to some shoes products and select 2 or more category. Then try to change category for this shoes via "Modify entity values" of bulk operations.
For my another site (not fresh install of commerce kickstart) on the "Modify entity values" selection page I have additional notice:
Notice: Undefined index: sku in CommerceProductInlineEntityFormController->entityForm() (line 185 of /var/www/jewel2/profiles/commerce_kickstart/modules/contrib/inline_entity_form/includes/commerce_product.inline_entity_form.inc).
Notice: Undefined index: status in CommerceProductInlineEntityFormController->entityForm() (line 204 of /var/www/jewel2/profiles/commerce_kickstart/modules/contrib/inline_entity_form/includes/commerce_product.inline_entity_form.inc).

Can you help me with multiple change category for products?

CommentFileSizeAuthor
#5 ps.png59.13 KBDr.Osd
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

Title: This SKU is already in use and must be unique. Please supply another value » The modify entity values action doesn't work with Inline Entity Form
Category: Support request » Bug report
Issue summary: View changes

Retitling.

pit_zavra’s picture

When i try to "modify entity" and change the category of the selected products i have the same error "This SKU is already in use and must be unique. Please supply another value"

I noticed in the database at table "commerce_product" that it creates a product with an empty SKU value. I then copy the product_id from that row and run a database search in all tables for that product_id and delete all the entries.

Then when i try to modify entity values it works only once perfectly. But after that, it creates again another empty sku entry, and the same error appears if you try to modify entity values again.

I think the problem is that because it creates a product with an empty sku, when you try to modify anything with the bulk operations tool, it somehow tries to create a product with an empty sku field ant it cant do that, because in the database there is already a product with an empty sku value so it thinks that it is a duplicate.

My english is not very good i hope i dident confuse anyone.

pit_zavra’s picture

Actualy you can delete the product with the empty sku value from here

admin/commerce/products/variations

Its the same thing. This helped me a lot.

Dr.Osd’s picture

Title: The modify entity values action doesn't work with Inline Entity Form » The modify entity values action in the VBO try to make new excess product variation with empty SKU, title and price.
Dr.Osd’s picture

FileSize
59.13 KB
Dr.Osd’s picture

Thanks Pit_zavra.
It is really so. After each use "modify entity values", necessary delete the product variation with empty fields.

bharata’s picture

I just wanted to update this thread for anyone looking to solve this issue.

Deleting the empty product didn't work for me. That's no solution anyway.

The real question is: Why is the "product with the empty sku value" getting created in the first place?

It has to do with some interaction between Inline Entity Form and VBO. They both work fine on their own, but not together - at least not when trying to "modify entity values".

I found the answer here: https://drupal.org/node/2113847

In a nutshell: downgrading from the current recommended release of Inline Entity Form to inline_entity_form 7.x-1.2 fixes this behaviour.

Hope this helps someone!

bojanz’s picture

Status: Active » Fixed

Inline Entity Form 1.5 wokrs fine (by presenting a different widget when inside "modify entity values")

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.