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

Hi @MaximGns. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

m2-assistant[bot] avatar Jun 13 '24 12:06 m2-assistant[bot]

Hi @MaximGns,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.

Steps to reproduce

  • Use the product bulk api.
  • Create product with required attributes from the attribute set.
  • Add new attribute to the used attribute set and save
  • Import the product again using the bulk api having the new attribute in the payload
  • Attribute value is not saved on the product
Screenshot 2024-07-02 at 13 17 55 Screenshot 2024-07-02 at 13 18 38

Product is missing attribute values that are recently added to the set.

Hence Confirming the issue.

Thanks.

engcom-Bravo avatar Jul 02 '24 07:07 engcom-Bravo

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12321 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Jul 02 '24 08:07 github-jira-sync-bot

:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] avatar Jul 02 '24 08:07 m2-assistant[bot]

@magento I am working on it

MaximGns avatar Jul 11 '24 09:07 MaximGns