ACP2E-5183:静态内容部署在具有@magento_import的PHP 8.5上失败

ACP2E-5183修补程序修复了静态内容部署在PHP 8.5上失败的问题,错误为​当模块LESS文件使用@magento_import指令时,不建议使用null作为数组偏移。 安装Quality Patches Tool (QPT) 1.1.84时,此修补程序可用。 修补程序ID为ACP2E-5183。 请注意,此问题计划在Adobe Commerce 2.4.10中修复。

受影响的产品和版本

为Adobe Commerce版本创建了修补程序:

  • Adobe Commerce(所有部署方法) 2.4.9

与Adobe Commerce版本兼容:

  • Adobe Commerce(所有部署方法) 2.4.4 - 2.4.9
NOTE
该修补程序可能适用于具有新Quality Patches Tool发行版本的其他版本。 要检查修补程序是否与您的Adobe Commerce版本兼容,请将magento/quality-patches包更新到最新版本,并在Quality Patches Tool:搜索修补程序页面上检查兼容性。 使用修补程序ID作为搜索关键字来查找修补程序。

问题

PHP 8.5上的静态内容部署失败,错误为​当模块LESS文件使用@magento_import指令时,不建议使用null作为数组偏移。

先决条件:

已安装PHP 8.5。

重现步骤:

  1. 启用自定义模块,该模块提供包含自定义电子邮件正文样式和@magento_import指令的email-inline.less文件。

  2. 删除静态内容和生成的文件:

    code language-none
    rm -rf pub/static/frontend/* var/view_preprocessed/* generated/code/*
    
  3. 使用压缩策略执行静态内容部署:

    code language-none
    bin/magento setup:static-content:deploy --ansi --no-interaction -f -s compact --jobs 4 --no-html-minify
    

预期的结果:

静态内容部署成功完成,并为模块提供的LESS文件生成编译的CSS。

实际结果:

编译模块提供的email-inline.less文件和报告时静态内容部署中止:

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

应用修补程序

要应用单独的修补程序,请根据您的部署方法使用以下链接:

相关阅读

要了解有关Quality Patches Tool的更多信息,请参阅:

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