ACSD-56842: Deferred proxies and proxy factories are missing after running setup:di:compile

The ACSD-56842 patch fixes the issue where the deferred proxies and proxy factories are missing after running setup:di:compile. This patch is available when the Quality Patches Tool (QPT) 1.1.46 is installed. The patch ID is ACSD-56842. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.7.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.4-p6

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.2 - 2.4.6-p3
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

The deferred proxies and proxy factories are missing after running setup:di:compile.

Steps to reproduce:

  1. Create a custom module named Magento_CustomModule.

  2. In the etc folder of the module, create a di.xml with this content:

    code language-xml
     <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
         <type name="Magento\Catalog\Model\ProductLink\CollectionProvider">
            <arguments>
               <argument name="providers" xsi:type="array">
                  <item name="crosssell" xsi:type="object">
                       Magento\Catalog\Model\ProductLink\CollectionProvider\Crosssell\Proxy
                  </item>
                    <item name="upsell" xsi:type="object">Magento\Catalog\Model\ProductLink\CollectionProvider\Upsell\Proxy</item>
                      <item name="related" xsi:type="object">Magento\Catalog\Model\ProductLink\CollectionProvider\Related\Proxy</item>
               </argument>
            </arguments>
          </type>
             <type name="Magento\Catalog\Model\Product">
                <arguments>
                   <argument name="catalogProductStatus" xsi:type="object">
                    Magento\Catalog\Model\Product\Attribute\Source\Status\Proxy
                   </argument>
                    <argument name="productLink" xsi:type="object">
                      Magento\Catalog\Model\Product\Link\Proxy
                    </argument>
                </arguments>
              </type>
      </config>
    
  3. Set the Production mode: bin/magento deploy:mode:set production.

  4. Delete the generated folder from the magento root.

  5. Run the command bin/magento setup:di:compile.

  6. Check the generated folder.

Expected results:

  • Proxy files are successfully created after compilation.
  • Factory files are successfully created after compilation.

Actual results:

In the generated folder, the proxy file is generated for proxy arguments that are given without a line break, and not for the arguments that are given with a line break.

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:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3