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
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the 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:

  1. In the Admin, go to Stores > Attributes > Attribute Set, open the Default attribute set, drag the color attribute from Unassigned Attributes into a group, and click Save.
  2. Go to Stores > Attributes > Product, open the color attribute, add a few options under Manage Options (Values of Your Attribute), and click Save Attribute.
  3. 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:

To learn more about Quality Patches Tool, refer to:

recommendation-more-help
commerce-operations-help-tools