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
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

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:

  1. Enable a custom module that provides a email-inline.less file containing a custom email body style and a @magento_import directive.

  2. Remove static content and generated files:

    code language-none
    rm -rf pub/static/frontend/* var/view_preprocessed/* generated/code/*
    
  3. 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:

To learn more about Quality Patches Tool, refer to:

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