Skip to content

Underscores not allowed in module names in \Magento\Framework\App\Utility\Files::accumulateThemeStaticFiles  #32619

Closed
@bentideswell

Description

@bentideswell

PSR-4 dictates that underscores have no special meaning and can be used in module names. There have been multiple PRs accepted for this bug in other areas of Magento but this one has been missed.

This is in \Magento\Framework\App\Utility\Files::accumulateThemeStaticFiles. This method collates static files from your theme. The bug means that it's not possible to extend a static file from a module that has an underscore in the module name (eg. FishPig_WordPress_IntegratedSearch).

Preconditions (*)

  1. Magento 2.4.2 - but this is probably present in all versions from 2.0.0

Steps to reproduce (*)

  1. Install Magento 2.4.2
  2. Extend a CSS file from a module with an underscore in the module name (app/design/frontend/YourVendor/YourTheme/ThirdParty_Module_Test/web/css/source/_module.less)
  3. Compile the static assets

Expected result (*)

The _module.less is processed correctly

Actual result (*)

Error happened during deploy process: Could not parse theme static file '/var/www/test-siteapp/design/frontend/YourVendor/YourTheme/ThirdParty_Module_Test/web/css/source/_module.less'


  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.

Metadata

Metadata

Labels

Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ready for confirmationPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneSeverity: S1Affects critical data or functionality and forces users to employ a workaround.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions