-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fix > Exception #0 (BadMethodCallException): Missing required argument $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator. #22191
Conversation
Hi @lfluvisotto. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
app/code/Magento/Msrp/etc/module.xml
Outdated
@@ -9,6 +9,8 @@ | |||
<module name="Magento_Msrp" > | |||
<sequence> | |||
<module name="Magento_Catalog"/> | |||
<module name="Magento_MsrpConfigurableProduct"/> | |||
<module name="Magento_MsrpGroupedProduct"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such dependency is incorrect. Those modules must depend on Msrp
and not vise versa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In > app/code/Magento/MsrpConfigurableProduct/etc/module.xml there is the dependency / sequence with module Magento_Msrp, so far, so good.
In > app/code/Magento/MsrpGroupedProduct/etc/module.xml there is the dependency / sequence with module Magento_Msrp, so far, so good.
But if you disable these modules MsrpConfigurableProduct and MsrpGroupedProduct, the module Magento_Msrp is dependent of MsrpConfigurableProduct or MsrpGroupedProduct.
The file app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php > public function __construct(array $msrpPriceCalculators) > it's supposed to receive as an argument MsrpConfigurableProduct or MsrpGroupedProduct
With both modules MsrpConfigurableProduct and MsrpGroupedProduct disabled the crash happens.
These are declared in:
app/code/Magento/MsrpConfigurableProduct/etc/di.xml
app/code/Magento/MsrpGroupedProduct/etc/di.xml
The way Magento_Msrp was built/developed is dependent of MsrpConfigurableProduct and MsrpGroupedProduct
Have a look at this commit:
MsrpConfigurableProduct provides type and resolver information for the Msrp module from the ConfigurableProduct module.
MsrpGroupedProduct provides type and resolver information for the Msrp module from the GroupedProduct module.
Msrp is attached to MsrpConfigurableProduct and MsrpGroupedProduct
I've checked again my solution but it's wrong it's generating > Circular sequence reference Disregard my pull request, a refactoring is necessary in Magento_Msrp, possibly in app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php |
…t $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator.
7e92e39
to
fc26316
Compare
Hi @lfluvisotto, thank you for your contribution! |
Have a look at my new pull request #22197 I hope it's ok now. |
Description (*)
Fix > Exception #0 (BadMethodCallException): Missing required argument $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator.
Fixed Issues (if relevant)
#22190: Exception (BadMethodCallException): Missing required argument $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator.
Manual testing scenarios (*)
Contribution checklist (*)