ACP2E-3752: Product import throws an undefined array key error when many import operations run
The ACP2E-3752 patch fixes the issue where product import processing throws the error Warning: Undefined array key “apply_to” when many product import operations are created. This patch is available when the Quality Patches Tool (QPT) 1.1.86 is installed. The patch ID is ACP2E-3752. Please note that this issue was fixed in Adobe Commerce 2.4.9.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.7, 2.4.8-p5
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.7 - 2.4.8-p5
magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
Product import processing throws the error Warning: Undefined array key “apply_to” when many product import operations are created.
Steps to reproduce:
- In the Admin, go to Stores > Attributes > Attribute Set, open the Default attribute set, drag the
colorattribute from Unassigned Attributes into a group, and click Save. - Go to Stores > Attributes > Product, open the
colorattribute, add a few options under Manage Options (Values of Your Attribute), and click Save Attribute. - Run a custom process that creates a new product import model instance many times in the same PHP process. For example, use a console command of a custom module that creates the instance 10,000 times in a loop.
Expected results:
The process finishes without errors.
Actual results:
The process fails with the error Warning: Undefined array key “apply_to”, depending on when PHP garbage collection runs.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide