Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento_Newsletter cannot be disabled #26194

Open
kassner opened this issue Dec 27, 2019 · 15 comments
Open

Magento_Newsletter cannot be disabled #26194

kassner opened this issue Dec 27, 2019 · 15 comments
Labels
Area: Install & Administer CD Issue recommended for the contribution day Component: Customer Component: Newsletter Event: dmcdindia2020 Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Risk: medium Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@kassner
Copy link
Contributor

kassner commented Dec 27, 2019

There are several classes under the Magento\Customer (and one under Magento\Review) namespace that are requiring Magento\Newsletter classes, making it impossible to successfully disable/remove the newsletter module, if one uses another solution.

  1. Magento\Customer\Block\Account\Dashboard
  2. Magento\Customer\Block\Account\Dashboard\Info
  3. Magento\Customer\Block\Adminhml\Edit\Tab\Newsletter
  4. Magento\Customer\Block\Adminhml\Edit\Tab\Newsletter\Grid
  5. Magento\Customer\Block\Adminhml\Edit\Tab\Newsletter\Grid\Renderer\Status
  6. Magento\Customer\Controller\Adminhtml\Index
  7. Magento\Customer\Controller\Adminhtml\Index\Cart
  8. Magento\Customer\Controller\Adminhtml\Index\Newsletter
  9. Magento\Customer\Controller\Adminhtml\Index\Save
  10. Magento\Customer\Controller\Adminhtml\Index\Viewfile
  11. Magento\Customer\Controller\Adminhtml\Customer\InvalidateToken
  12. Magento\Review\Block\Customer\ListCustomer

From those classes, several ones are requiring \Magento\Newsletter\Model\SubscriberFactory but they end up not even using it, basically declaring dependencies to classes that are not needed.

Preconditions

  1. To a instance of Magento 2.3.3 installed via Composer, add the following section to the composer.json:
{
  "replace": {
    "magento/module-newsletter": "*"
  }
}

Steps to reproduce

  1. composer update --lock -vvv;
  2. php bin/magento setup:di:compile

Expected result

  1. Compilation is successful.

Actual result

  Class Magento\Newsletter\Model\SubscriberFactory does not exist                                                                                                                                                                                                                                                            
  Class Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only.  
@m2-assistant
Copy link

m2-assistant bot commented Dec 27, 2019

Hi @kassner. 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.4-develop instance - upcoming 2.4.x release

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

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

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Dec 27, 2019
@kassner
Copy link
Contributor Author

kassner commented Dec 27, 2019

I could write a PR for that, but given this will break backwards compatibility, which Magento release could a PR be targeted to?

@gwharton
Copy link
Contributor

2.4-develop i would imagine is currently accepting breaking changes as 2.4 is not out yet.

@shikhamis11 shikhamis11 self-assigned this Dec 30, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 30, 2019

Hi @shikhamis11. 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: 👇

  • 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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.

@augrinovska augrinovska self-assigned this Jan 2, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jan 2, 2020

Hi @augrinovska. 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: 👇

  • 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.4-develop branch

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


@augrinovska
Copy link
Member

Hi @kassner,

Your Actual Result is related to the permissions of the generated folder.

Class Magento\Customer\Controller\Adminhtml\Index\Save\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only.

Please follow the documentation to set up the right permissions to the folder -> https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html

@magento-engcom-team I couldn't reproduce the issue on 2.4-develop branch

@kassner
Copy link
Contributor Author

kassner commented Jan 2, 2020

@augrinovska

The Actual result has two lines, the first one being:

Class Magento\Newsletter\Model\SubscriberFactory does not exist   

Because that class doesn't exist, the model generation for the second one fails as well. It has nothing to do with the permissions, the second error happens because it was trying to read the class from the generated folder and it wasn't there, because it failed while generating the previous class.

In any case, this can be also very easily checked by looking into the source code. For example, app/code/Magento/Customer/Block/Account/Dashboard.php on 2.4-develop is trying to use the SubscriberFactory class, which is declared inside the Magento_Newsletter module.

So, please open the ticket again, as you will not be able to test this error on 2.4-develop unless you manually delete the app/code/Magento/Newsletter before running the compilation.

@augrinovska augrinovska reopened this Jan 3, 2020
@ghost ghost unassigned shikhamis11 and augrinovska Jan 3, 2020
@engcom-Hotel engcom-Hotel self-assigned this Jan 15, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jan 15, 2020

Hi @engcom-Hotel. 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: 👇

  • 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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.

@engcom-Hotel engcom-Hotel added Component: Customer Component: Newsletter Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Jan 16, 2020
@ghost ghost unassigned engcom-Hotel Jan 16, 2020
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jan 16, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Hotel
Thank you for verifying the issue. Based on the provided information internal tickets MC-30471 were created

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

@vimal-ranosys vimal-ranosys self-assigned this Jan 18, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jan 18, 2020

Hi @vimal-ranosys. 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.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.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.


@magento-engcom-team magento-engcom-team added this to Dev in Progress in Community Backlog Mar 24, 2020
@sdzhepa sdzhepa added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Jul 21, 2020
@sidolov sidolov added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Sep 15, 2020
@sidolov sidolov added Risk: medium Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Sep 15, 2020
@ghost ghost moved this from Dev in Progress to Ready for Dev in Community Backlog Sep 15, 2020
@sidolov sidolov added this to Ready for Development in Low Priority Backlog Sep 24, 2020
@sivaschenko sivaschenko added the CD Issue recommended for the contribution day label Oct 7, 2020
@vikalps4
Copy link

vikalps4 commented Oct 9, 2020

@magento I am working on this.

@m2-community-project m2-community-project bot moved this from Ready for Development to Dev In Progress in Low Priority Backlog Oct 9, 2020
@vikalps4
Copy link

#dmcdindia2020

@sidolov sidolov added this to Dev In Progress in High Priority Backlog Oct 20, 2020
@ghost ghost removed this from Ready for Dev in Community Backlog Oct 20, 2020
@ghost ghost removed this from Dev In Progress in Low Priority Backlog Oct 20, 2020
@ghost ghost unassigned vikalps4 Nov 4, 2020
@m2-community-project m2-community-project bot moved this from Dev In Progress to Ready for Development in High Priority Backlog Nov 4, 2020
@korostii
Copy link
Contributor

@sivaschenko @sidolov This looks like a fun issue to work on, but it's still unclear what would be the best way to approach it, considering backwards compatibility. For example, Magento\Customer\Block\Account\Dashboard is marked as @api - is that something that could be reconsidered for 2.5? And apart from that, removing injected classes from constructors would involve deprecating them first, is that still true? (looking at Magento\Customer\Controller\Adminhtml, for example)

What kind of changes would be welcome here & are there any plans to have a 2.5-develop branch to point such PRs to ?

@sivaschenko
Copy link
Member

@korostii it looks like we'll need to introduce the alternative to the API classes dependent on Newsletter and mark that API as deprecated first (I think it would be good to do that in 2.4, so that we can remove them in 2.5).

@sidolov what do you think about this?

Yes, there are plans to create 2.5-develop branch soon

@Aquive
Copy link

Aquive commented Sep 22, 2021

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Install & Administer CD Issue recommended for the contribution day Component: Customer Component: Newsletter Event: dmcdindia2020 Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Risk: medium Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
High Priority Backlog
  
Ready for Development
Development

No branches or pull requests