magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Attribute set info is cached (EAV cache), but not cleaned after the attribute set updated in admin area

Open MaximGns opened this issue 1 year ago • 1 comments

Preconditions and environment

  • Magento version: 2.4.6-p5
  • Anything else that would help a developer reproduce the bug

``

Steps to reproduce

  1. Use the product bulk api.
  2. Create product with required attributes from the attribute set.
  3. Add new attribute to the used attribute set and save
  4. Import the product again using the bulk api having the new attribute in the payload
  5. Attribute value is not saved on the product

Expected result

After a set is being updated and the eav cache is enabled, the related cache key of the set is being cleaned. Importing the same payload will have all attribute codes saved to the product that are present on the attribute set

Actual result

Product is missing attribute values that are recently added to the set without cleanen the cache manually

Additional information

See: \Magento\Eav\Model\ResourceModel\Entity\Attribute

    protected function _afterSave(AbstractModel $object)
    {
        $this->_saveStoreLabels(
            $object
        )->_saveAdditionalAttributeData(
            $object
        )->saveInSetIncluding(
            $object
        )->_saveOption(
            $object
        );
        $this->getConfig()->clear();
        return parent::_afterSave($object);
    }

Nothing is in place for the Set model: \Magento\Eav\Model\Entity\Attribute\Set

Set info is cached here: \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set::getSetInfo

Release note

No response

Triage and priority

  • [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [X] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

MaximGns avatar Jun 13 '24 12:06 MaximGns