magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Static content is deploying for disabled modules

Open shkodasv opened this issue 5 years ago • 18 comments

Summary (*)

  • Original summary from the reporter :

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 (*)

  • reproduced on 2.3-develop

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 (*)

  • Not finding a reference to the selector .payment-method-braintree

Actual result (*)

  • Finding references to the selector .payment-method-braintree

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?

shkodasv avatar Sep 20 '19 09:09 shkodasv

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

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

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?

  • [ ] yes
  • [ ] no

m2-assistant[bot] avatar Sep 20 '19 09:09 m2-assistant[bot]

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:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Sep 20 '19 09:09 m2-assistant[bot]

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.

engcom-Bravo avatar Sep 20 '19 09:09 engcom-Bravo

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

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

Expected result:

  • Not finding a reference to the selector .payment-method-braintree

Actual result:

  • Finding references to the selector .payment-method-braintree

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?

hostep avatar Sep 20 '19 19:09 hostep

Ok @hostep, I'll check it.

engcom-Bravo avatar Sep 20 '19 20:09 engcom-Bravo

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

shkodasv avatar Sep 20 '19 20:09 shkodasv

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:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

m2-assistant[bot] avatar Sep 23 '19 08:09 m2-assistant[bot]

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

engcom-Bravo avatar Sep 23 '19 08:09 engcom-Bravo

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

sdzhepa avatar Sep 26 '19 20:09 sdzhepa

@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 avatar Sep 26 '19 20:09 magento-engcom-team

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

magento-engcom-team avatar Sep 26 '19 20:09 magento-engcom-team

@magento I'm working on it.

rganzhuyev avatar Sep 27 '19 08:09 rganzhuyev

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

m2-assistant[bot] avatar Sep 27 '19 08:09 m2-assistant[bot]

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:

  • [x] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [x] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


m2-assistant[bot] avatar Sep 27 '19 08:09 m2-assistant[bot]

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:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


m2-assistant[bot] avatar Oct 21 '19 08:10 m2-assistant[bot]

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

cc @shkodasv

vasilii-b avatar Feb 15 '21 15:02 vasilii-b

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

github-jira-sync-bot avatar Sep 21 '21 07:09 github-jira-sync-bot

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

m2-assistant[bot] avatar Sep 21 '21 07:09 m2-assistant[bot]