ACP2E-5183: Static content deployment fails on PHP 8.5 with @magento_import
The ACP2E-5183 patch fixes the issue where static content deployment fails on PHP 8.5 with the error Using null as an array offset is deprecated when a module LESS file uses the @magento_import directive. This patch is available when the Quality Patches Tool (QPT) 1.1.84 is installed. The patch ID is ACP2E-5183. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.10.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.9
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.4 - 2.4.9
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
Static content deployment fails on PHP 8.5 with the error Using null as an array offset is deprecated when a module LESS file uses the @magento_import directive.
Prerequisites:
PHP 8.5 is installed.
Steps to reproduce:
-
Enable a custom module that provides a
email-inline.lessfile containing a custom email body style and a@magento_importdirective. -
Remove static content and generated files:
code language-none rm -rf pub/static/frontend/* var/view_preprocessed/* generated/code/* -
Execute static content deployment using the compact strategy:
code language-none bin/magento setup:static-content:deploy --ansi --no-interaction -f -s compact --jobs 4 --no-html-minify
Expected results:
Static content deployment completes successfully and generates the compiled CSS for the module-provided LESS file.
Actual results:
Static content deployment aborts while compiling the module-provided email-inline.less file and reports:
Deprecated Functionality: Using null as an array offset is deprecated, use an empty string instead in <magento_root>/vendor/magento/framework/Component/ComponentRegistrar.php on line 71
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