{"data":{"id":"magento2-32922","source":"github-pr","sourceRef":"magento/magento2#32922","title":"Static content is deploying for disabled modules","pr":{"number":32922,"url":"https://github.com/magento/magento2/pull/32922","author":"mrtuvn","mergedAt":"2024-07-14T04:11:58Z","mergeCommit":"78749c01a4d15273258731fa0ae675529cba9298","headCommit":"60b953dce93d7c02961fbb2fe84c4878eb3b25ae","baseRef":"2.4-develop","diffSha256":"b27a0d989733bcf289ac463213a00de5c3416d8373429a6d4336874186cd4667"},"issues":[{"number":24666,"url":"https://github.com/magento/magento2/issues/24666","title":"Static content is deploying for disabled modules","labels":["Area: UI Framework","Component: CSS","Component: Deploy","Issue: Confirmed","Issue: Format is valid","Issue: Ready for Work","Priority: P2","Progress: done","Reproduced on 2.3.x","Reproduced on 2.4.x","Severity: S2","Triage: Done"],"kind":"human"}],"fixedIn":"2.4.8","containingTags":["2.4.8","2.4.8-p1","2.4.8-p2","2.4.8-p3","2.4.8-p4","2.4.8-p5","2.4.9"],"reportedOn":null,"codeMatch":{"2.4.6":"conflict","2.4.6-p1":"conflict","2.4.6-p2":"conflict","2.4.6-p3":"conflict","2.4.6-p4":"conflict","2.4.6-p5":"conflict","2.4.6-p6":"conflict","2.4.6-p7":"conflict","2.4.6-p8":"conflict","2.4.6-p9":"conflict","2.4.6-p10":"conflict","2.4.6-p11":"conflict","2.4.6-p12":"conflict","2.4.6-p13":"conflict","2.4.6-p14":"conflict","2.4.6-p15":"conflict","2.4.7":"clean","2.4.7-p1":"clean","2.4.7-p2":"clean","2.4.7-p3":"clean","2.4.7-p4":"clean","2.4.7-p5":"clean","2.4.7-p6":"clean","2.4.7-p7":"clean","2.4.7-p8":"clean","2.4.7-p9":"clean","2.4.7-p10":"clean","2.4.8":"conflict","2.4.8-p1":"conflict","2.4.8-p2":"conflict","2.4.8-p3":"conflict","2.4.8-p4":"conflict","2.4.8-p5":"conflict","2.4.9":"conflict"},"affectedVersions":["2.4.7","2.4.7-p1","2.4.7-p2","2.4.7-p3","2.4.7-p4","2.4.7-p5","2.4.7-p6","2.4.7-p7","2.4.7-p8","2.4.7-p9","2.4.7-p10"],"components":["magento/framework"],"files":[{"path":"lib/internal/Magento/Framework/Css/PreProcessor/Instruction/MagentoImport.php","change":"modified","package":"magento/framework"}],"stripped":{"tests":["lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Instruction/MagentoImportTest.php"],"docs":[],"outsideCode":[]},"linesChanged":69,"mergeBatched":false,"excluded":null,"sections":{"description":"- Finding references to the selector `.payment-method-braintree`","stepsToReproduce":"1. Setup vanilla 2.3-develop installation\n2. Take a look at the file `app/design/frontend/Magento/blank/Magento_Braintree/web/css/source/_module.less`, notice the selector `.payment-method-braintree` is in there and also notice this selector is in no other file in the Magento source code except for this file in the `Magento_Braintree` module in the \n`Magento/Blank` theme.\n3. Now disable that module (and its dependency): `bin/magento module:disable Magento_Braintree Magento_BraintreeGraphQl`\n4. Remove potential left over files: `rm -R var/view_preprocessed/* pub/static/*`\n5. Run static content deploy: `bin/magento setup:static-content:deploy -f --theme Magento/blank en_US`\n6. Look at the generated file `pub/static/frontend/Magento/blank/en_US/css/styles-m.css`","expectedResult":"- Not finding a reference to the selector `.payment-method-braintree`","actualResult":"- Finding references to the selector `.payment-method-braintree`\n\n*Update*: In hindsight, @shkodasv is talking about the deprecated \"disabling module output\" feature of Magento which was removed in Magento 2.2 I believe. But the issue is still valid for disabled modules as well, or should we open a new issue then?","source":"issue"},"signatures":[],"labels":{"area":["UI Framework"],"component":["CSS","Deploy"],"priority":"P2","severity":"S2","reportedOn":[]},"categories":[],"triage":{"model":"@cf/cloudflare/clef","requestHash":"b0b2e6d1e54dd58bc74eb11217608572dd152b7747647ec7aed4d6cf419cc20c","isBugfix":0.7876,"changeKind":{"choice":"bugfix","probabilities":{"bugfix":0.7604,"feature":0.1969,"refactor":0.0243,"tests_only":0.0098,"docs_only":0.004,"dependency":0.0046},"confidence":0.5413},"scope":{"score":0.9962,"probabilities":{"0":0.3257,"1":0.3523,"2":0.322},"confidence":0.0008},"risk":{"score":0.6509,"probabilities":{"0":0.3916,"1":0.5658,"2":0.0426},"confidence":0.213},"area":{"choice":"frontend","probabilities":{"catalog":0.004,"checkout":0.0054,"customer":0.0036,"admin":0.0089,"graphql_api":0.0025,"framework":0.1961,"frontend":0.7699,"other":0.0096},"confidence":0.5788},"securityRelevant":0.0073,"reportedVersion":{"choice":"unspecified","probabilities":{"2.4.0":0.0063,"2.4.0-p1":0.0068,"2.4.1":0.0082,"2.4.1-p1":0.0067,"2.4.2":0.0095,"2.4.2-p1":0.0071,"2.4.2-p2":0.0094,"2.4.3":0.0127,"2.4.3-p1":0.0135,"2.4.3-p2":0.0106,"2.4.3-p3":0.0075,"2.4.4":0.0074,"2.4.4-p1":0.0066,"2.4.4-p10":0.0046,"2.4.4-p11":0.0068,"2.4.4-p12":0.0062,"2.4.4-p13":0.0071,"2.4.4-p14":0.006,"2.4.4-p15":0.0057,"2.4.4-p16":0.005,"2.4.4-p17":0.0046,"2.4.4-p18":0.0049,"2.4.4-p2":0.0036,"2.4.4-p3":0.004,"2.4.4-p4":0.0043,"2.4.4-p5":0.0051,"2.4.4-p6":0.0048,"2.4.4-p7":0.0048,"2.4.4-p8":0.0044,"2.4.4-p9":0.0035,"2.4.5":0.006,"2.4.5-p1":0.0066,"2.4.5-p10":0.0049,"2.4.5-p11":0.007,"2.4.5-p12":0.0075,"2.4.5-p13":0.0071,"2.4.5-p14":0.0082,"2.4.5-p15":0.0052,"2.4.5-p16":0.0055,"2.4.5-p17":0.005,"2.4.5-p2":0.0039,"2.4.5-p3":0.0051,"2.4.5-p4":0.0054,"2.4.5-p5":0.0055,"2.4.5-p6":0.0047,"2.4.5-p7":0.0056,"2.4.5-p8":0.0054,"2.4.5-p9":0.0036,"2.4.6":0.0088,"2.4.6-p1":0.0113,"2.4.6-p10":0.0086,"2.4.6-p11":0.0088,"2.4.6-p12":0.0083,"2.4.6-p13":0.0083,"2.4.6-p14":0.0068,"2.4.6-p15":0.007,"2.4.6-p2":0.0044,"2.4.6-p3":0.0066,"2.4.6-p4":0.0083,"2.4.6-p5":0.0063,"2.4.6-p6":0.007,"2.4.6-p7":0.008,"2.4.6-p8":0.0067,"2.4.6-p9":0.0044,"2.4.7":0.0067,"2.4.7-p1":0.0071,"2.4.7-p10":0.0071,"2.4.7-p2":0.0065,"2.4.7-p3":0.009,"2.4.7-p4":0.0131,"2.4.7-p5":0.0114,"2.4.7-p6":0.0098,"2.4.7-p7":0.0087,"2.4.7-p8":0.0085,"2.4.7-p9":0.0048,"2.4.8":0.0081,"2.4.8-p1":0.0086,"2.4.8-p2":0.011,"2.4.8-p3":0.014,"2.4.8-p4":0.0131,"2.4.8-p5":0.0106,"2.4.9":0.0113,"unspecified":0.4111},"confidence":0.1637},"backportWorthy":{"score":1.0768,"probabilities":{"0":0.2993,"1":0.3247,"2":0.376},"confidence":0.0046}},"curated":{"title":"Excludes styles of disabled modules from compiled CSS when configured","description":"Styles from all modules, enabled or not, are added to the final css output, so styles of disabled modules end up there too. When static_content_only_enabled_modules is set in app/etc/env.php or config.php, Framework Css PreProcessor MagentoImport.php does not import styles of disabled modules for @magento_import.","categories":[],"author":"claude-code/opus-5.5","date":"2026-10-06","reviewedBy":null},"tests":{"2.4.7-p10":{"before":"fail","after":"pass","adapted":false,"runAt":"2026-10-06T09:29:09.577Z","releaseCommit":"72561bf80652f57cc642a03e2c9a51d74a285b14","suites":{"unit":{"before":"fail","after":"pass","runAt":"2026-10-06T09:29:09.577Z"}}}}},"_documentation":"https://magento.watch/api","_description":"Upstream fix magento2-32922 details"}