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
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:
-
Create a custom module named Magento_CustomModule.
-
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>
-
Set the Production mode:
bin/magento deploy:mode:set production
. -
Delete the generated folder from the magento root.
-
Run the command
bin/magento setup:di:compile
. -
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:
- 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 released: a new tool to self-serve quality patches in the support knowledge base.
- Check if patch is available for your Adobe Commerce issue using Quality Patches Tool in the Quality Patches Tool guide.
For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.