magento2
magento2 copied to clipboard
Magento_Paypal module has dependency on Magento_Csp module
Preconditions and environment
- Magento Open Source 2.4.7
Steps to reproduce
This file has a dependency on Magento_Csp: https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Paypal/Model/Config.php#L9
However it's not listed in the modules module.xml.
Expected result
Do not use Magento_Csp in module, or declare it as a dependency in the module.xml
Actual result
When Magento_Csp is disabled product detail pages throw an error because of the missing dependency:
==> exception.log <== [2024-05-28T09:50:40.591031+00:00] main.CRITICAL: Error: Cannot instantiate interface Magento\Csp\Model\Collector\MergerInterface in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Stack trace: #0 vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() #1 vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create() #2 vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get() #3 vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create() #4 vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get() #5 vendor/magento/framework/ObjectManager/ObjectManager.php(73): Magento\Framework\ObjectManager\Factory\Compiled->create() #6 vendor/magento/module-paypal/Model/Config.php(642): Magento\Framework\ObjectManager\ObjectManager->get() #7 vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(121): Magento\Paypal\Model\Config->__construct() #8 vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject() #9 vendor/magento/framework/ObjectManager/ObjectManager.php(59): Magento\Framework\ObjectManager\Factory\Compiled->create() #10 generated/code/Magento/Paypal/Model/ConfigFactory.php(43): Magento\Framework\ObjectManager\ObjectManager->create() #11 vendor/magento/module-paypal/Model/PayLaterConfig.php(46): Magento\Paypal\Model\ConfigFactory->create()
Additional information
As Magento_Csp module cannot be disabled with 2.4.7 as it is tightly integrated, this issue can be reproduced by disabling the Magento_Csp module in 2.4.6 and upgrade it to 2.4.7.
Release note
No response
Triage and priority
- [ ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- [ ] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Hi @dverkade. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance- upcoming 2.4.x release- For more details, review the Magento Contributor Assistant documentation.
- Add a comment to assign the issue:
@magento I am working on this - To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Dash. 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:
-
- Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
-
- Verify that issue has a meaningful description and provides enough information to reproduce the issue.
-
- Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to.
- Add
-
- Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced 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!
- Verify that the issue is reproducible on
- Join Magento Community Engineering Slack and ask your questions in #github channel.
Hi @engcom-November. 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).
- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
- [ ] 3. Add
Area: XXXXXlabel to the ticket, indicating the functional areas it may be related to. - [ ] 4. Verify that the issue is reproducible on
2.4-developbranchDetails
- Add the comment@magento give me 2.4-develop instanceto deploy test instance on Magento infrastructure.
- If the issue is reproducible on2.4-developbranch, please, add the labelReproduced 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: Confirmedonce verification is complete. - [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hello @dverkade,
Thank you for the report and collaboration!
We were not able to reproduce this issue on 2.4.7 community edition and 2.4-develop.
Because the Magento_Csp module is a required dependency in composer.json file of Paypal module.
So whenever we try to disable Magento_Csp module it will throw below error:
Unable to change status of modules because of the following constraints:
Cannot disable Magento_Csp because modules depend on it:
Magento_Paypal: Magento_Paypal->Magento_Csp
Please let us know if we are missing something on this.
Thank you.
@dverkade: I've created https://github.com/baldwin-agency/magento2-module-csp-shim last week, if you at the moment don't want to use the CSP module and want to have a working Magento 2.4.7 project.
@hostep Thanks for adding this module!
Hello @dverkade,
Thank you for the report and collaboration!
We were not able to reproduce this issue on 2.4.7 community edition and 2.4-develop. Because the
Magento_Cspmodule is a required dependency in composer.json file of Paypal module.So whenever we try to disable
Magento_Cspmodule it will throw below error:Unable to change status of modules because of the following constraints: Cannot disable Magento_Csp because modules depend on it: Magento_Paypal: Magento_Paypal->Magento_CspPlease let us know if we are missing something on this.
Thank you.
@engcom-November that's true, but if you already have the Magento_Csp module disabled you'll run into the error mentioned in the ticket description. I also get it when trying to view the payment methods in the admin config, and when trying to place an order.
@engcom-November getting similar error , currently we are not using CSP module
Error: Cannot instantiate interface Magento\Csp\Model\Collector\MergerInterface in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
Hello @dverkade,
Thank you for the report and collaboration!
We are to to reproduce this issue with 2.4.6 and upgrading it to 2.4.7.
Disabled the Magento_Csp module in 2.4.6 and after updating it to 2.4.7, we got the below error when opening frontend:
main.CRITICAL: Error: Cannot instantiate interface Magento\Csp\Model\Collector\MergerInterface in /opt/homebrew/var/www/magento246p5ce/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
Hence confirming this issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12281 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
:x: You don't have permission to export this issue.
@magento I'm working on this
