magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Old categories are not removed at CSV import #15273

Closed kamilmaliszewski closed 3 years ago

kamilmaliszewski commented 6 years ago

Preconditions

  1. Magento 2.2.3
  2. PHP 7.1
  3. MySQL ver 14.14 Distrib 5.7.21

Steps to reproduce

  1. Add one product with SKU "Test" and "categories" = "category A" (via CSV import or Admin Panel)
  2. Prepare an update CSV with single product -> SKU "Test" and "categories" = "Category B"
  3. Go to import module
  4. Choose "Add/Update" option and select prepared CSV
  5. Import it

Expected result

  1. Category A will be removed from "Test" product
  2. Category B will be assigned to "Test" product
  3. Finally "Test" product will have only one category -> "Category B"

Actual result

  1. Product "Test" is assigned to "Category A" and "Category B", so both instead new one
  2. "Category A" is not removed from this product.

P.S I know that for "Replace" old categories will be removed, but I don't want to do "Replace", becuase the ID will be replaced by new one. I want to have the same ID for updated product.

P.S 2: The same issue is for Images added via CSV import

orlangur commented 6 years ago

Choose "Add/Update" option and select prepared CSV

Well, add/update should definitely not remove previously assigned categories.

kamilmaliszewski commented 6 years ago

@orlangur "Add/Update" means:

If you thnik that:

add/update should definitely not remove previously assigned categories.

Pleaes tell me how can I remove old category from product via CSV import. "Replace" will change the ID of products, so it is not solution.

Edit -> https://magento.stackexchange.com/questions/129974/functionality-of-add-update-replace-delete-clarity-needed Here the 1-st answer show the behavior of import for people who don't have knowledge about it. Generally:

ghost commented 6 years ago

@kamilmaliszewski, thank you for your report. We've acknowledged the issue and added to our backlog.

ghost commented 5 years ago

SQUASHTOBERFEST

magento-engcom-team commented 5 years ago

Hi @rahulwebkul. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

ankit-sf commented 5 years ago

Any update on this issue?

iRabi commented 5 years ago

Yes, finding same issue in 2.2.5.

duckchip commented 5 years ago

what's the status of this issue?

VincentMarmiesse commented 5 years ago

Hi, Any news on this issue? Still happening in 2.3.1.

DeanJMorgan commented 5 years ago

Hi, Any news on this issue? Still happening in 2.3.1.

I'd also like an update as this is something that I could do with being fixed.

VincentMarmiesse commented 5 years ago

FYI, PR #18898 fixed the issue for me

navneetbhardwaj commented 5 years ago

the same issue occurred in the REST API.

m2-assistant[bot] commented 4 years ago

Hi @rahulwebkul. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


ghost commented 4 years ago

@magento give me 2.3-develop instance

magento-engcom-team commented 4 years ago

Hi @rahulwebkul. Thank you for your request. I'm working on Magento 2.3-develop instance for you

magento-engcom-team commented 4 years ago

Hi @rahulwebkul, here is your Magento instance. Admin access: https://i-15273-2-3-develop.instances.magento-community.engineering/admin Login: admin Password: 123123q Instance will be terminated in up to 3 hours.

ghost commented 4 years ago

I am able to reproduce this issue on magento vanilla instance. issue exist in 2.3-develop branch

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions.

bigbadbaz commented 3 years ago

Preconditions

  1. Magento 2.2.3
  2. PHP 7.1
  3. MySQL ver 14.14 Distrib 5.7.21

Steps to reproduce

  1. Add one product with SKU "Test" and "categories" = "category A" (via CSV import or Admin Panel)
  2. Prepare an update CSV with single product -> SKU "Test" and "categories" = "Category B"
  3. Go to import module
  4. Choose "Add/Update" option and select prepared CSV
  5. Import it

Expected result

  1. Category A will be removed from "Test" product
  2. Category B will be assigned to "Test" product
  3. Finally "Test" product will have only one category -> "Category B"

Actual result

  1. Product "Test" is assigned to "Category A" and "Category B", so both instead new one
  2. "Category A" is not removed from this product.

P.S I know that for "Replace" old categories will be removed, but I don't want to do "Replace", becuase the ID will be replaced by new one. I want to have the same ID for updated product.

P.S 2: The same issue is for Images added via CSV import

Did you find a way of removing old categories during CSV import? I'm trying to do it with configurable products that have a lot of configurable options and a lot of categories, so I really don't want to remove old categories at the expense of losing the configurations, eg by creating a new product. Your help much appreciated.

danielleharvey commented 2 years ago

@bigbadbaz did you figure it out? I cannot seem to find a way to do it.

bigbadbaz commented 2 years ago

@bigbadbaz did you figure it out? I cannot seem to find a way to do it.

Only by getting this extension. You can create category groups and assign and remove categories at the same time.

https://magefan.com/magento-2-dynamic-categories

pearcemichal commented 3 months ago

the way I would expect it to work would be by putting EMPTYVALUE__ in the category column to remove the previously assigned data.

however, when I tried this it just created a new category called EMPTYVALUE__ and assigned it to the product

Am I correct in thinking this is the intended behavior?