magento-lts icon indicating copy to clipboard operation
magento-lts copied to clipboard

Product Attribute Type "Multiselect" Not Updated in EAV and Product_Flat Tables

Open empiricompany opened this issue 1 year ago • 3 comments

Preconditions (*)

OpenMage 20.1.0-rc5 but also encountered in latest 1.9.4.5 magento version php 7.4

Steps to reproduce (*)

  1. Create a new product attribute with this config: immagine

  2. Add same options value immagine

  3. Assign attribute to an Attribute Set

  4. Assign all options to a product immagine

  5. Remove one or more options from attribute immagine

Expected result (*)

  1. catalog_product_entity_text.value is updated without id of option deleted
  2. catalog_product_flat is updated without id of option deleted

Actual result (*)

  1. catalog_product_entity_text.value is not updated new value should be 238,239,240 without orphan 241 id option immagine

  2. also in catalog_product_flat column is not updated immagine

empiricompany avatar May 17 '23 15:05 empiricompany

I've known this bug since it was still called Magento. I agree it's an imperfection but I have to add that all functionality seems to work just fine and as such I would classify this as a cosmetic issue.

loekvangool avatar Jul 31 '23 18:07 loekvangool

I can confirm that for dropdown type such as color, if an option is deleted and there is a product with that color, the value in the table catalog_product_entity_int would still have the deleted color.

[edit] It's a bug because if you load the product, it would have a color which no longer exist.

kiatng avatar Aug 01 '23 07:08 kiatng

[edit] It's a bug because if you load the product, it would have a color which no longer exist.

AFAIK there is zero impact unless you actually examine the database row. OM silently ignores the deprecated value. Calls to getData(), getAttributeText() etc. have never lead me to major issues with this. There is no label associated anymore thus the label will never show up. The ID behind the label will also not show up in the front-end or admin.

That's no reason to not fix it, but IMO any fix would have to be low in complexity, be BC and have a negligible performance impact.

loekvangool avatar Aug 01 '23 17:08 loekvangool