magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Static content is deploying for disabled modules #24666

Closed shkodasv closed 4 months ago

shkodasv commented 5 years ago

Summary (*)

I disable module output for several modules (e.g Checkout, GiftRegestry) and would like to know how to exclude CSS related to these modules from styles-l/styles-m files? As I don't need to load extra CSS

Preconditions (*)

Steps to reproduce (*)

  1. Setup vanilla 2.3-develop installation
  2. 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 Magento/Blank theme.
  3. Now disable that module (and its dependency): bin/magento module:disable Magento_Braintree Magento_BraintreeGraphQl
  4. Remove potential left over files: rm -R var/view_preprocessed/* pub/static/*
  5. Run static content deploy: bin/magento setup:static-content:deploy -f --theme Magento/blank en_US
  6. Look at the generated file pub/static/frontend/Magento/blank/en_US/css/styles-m.css

Expected result (*)

Actual result (*)

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?

m2-assistant[bot] commented 5 years ago

Hi @shkodasv. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@shkodasv do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


m2-assistant[bot] commented 5 years ago

Hi @engcom-Bravo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 5 years ago

Hello @shkodasv. Thanks for applying, but the GitHub issue tracker is intended for Magento Core technical issues only. Please refer to the Community Forums or the Magento Stack Exchange site for advice or general discussion about this issue.

hostep commented 5 years ago

@shkodasv: I think you have a very valid point here.

@engcom-Bravo: in my opinion this is a bug and I'll re-open this ticket for now, feel free to discuss if you don't agree.

Steps to reproduce:

Expected result:

Actual result:

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?

engcom-Bravo commented 5 years ago

Ok @hostep, I'll check it.

shkodasv commented 5 years ago

@hostep Thanks for your reply. You are right "Disable module output" is deprecated. I didn't know it. But in case of disabling the module the same logic should work IMHO - no css should be included.

m2-assistant[bot] commented 5 years ago

Hi @engcom-Charlie. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Bravo commented 5 years ago

@hostep I reproduced the behavior following the steps You have provided. But I still better question my Lead on it before confirming the issue. Hopefully tomorrow I'll be back with the result.

sdzhepa commented 5 years ago

Hello @shkodasv @hostep @engcom-Bravo

Finally, I have received a response from the internal team and confirmation that it is a bug. Previously were several concerns probably it was by design or so.

I will update Issue title and content based on test steps from https://github.com/magento/magento2/issues/24666#issuecomment-533676872

magento-engcom-team commented 5 years ago

@sdzhepa Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

Once all required information is added, please add label "Issue: Confirmed" again. Thanks!

magento-engcom-team commented 5 years ago

:white_check_mark: Confirmed by @sdzhepa Thank you for verifying the issue. Based on the provided information internal tickets MC-20509 were created

Issue Available: @sdzhepa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

rganzhuyev commented 5 years ago

@magento I'm working on it.

m2-assistant[bot] commented 5 years ago

Hi @rganzhuyev! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and self-assign the issue.

m2-assistant[bot] commented 5 years ago

Hi @rganzhuyev. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


m2-assistant[bot] commented 5 years ago

Hi @Echron. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


vasilii-b commented 3 years ago

Hey guys, Until the PR in the core gets merged, feel free to use the approach described here.

cc @shkodasv

github-jira-sync-bot commented 3 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-1306 is successfully created for this GitHub issue.

m2-assistant[bot] commented 3 years ago

:white_check_mark: Confirmed by @engcom-Alfa. Thank you for verifying the issue.
Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.