From fc263169cb89d12212ed5731e978c2636c512f41 Mon Sep 17 00:00:00 2001 From: "Leandro F. L" Date: Mon, 8 Apr 2019 00:06:13 -0300 Subject: [PATCH] Fix > Exception #0 (BadMethodCallException): Missing required argument $msrpPriceCalculators of Magento\Msrp\Pricing\MsrpPriceCalculator. --- app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php b/app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php index 3d1e5ef0b8e6c..9257b0b78cda1 100644 --- a/app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php +++ b/app/code/Magento/Msrp/Pricing/MsrpPriceCalculator.php @@ -23,9 +23,15 @@ class MsrpPriceCalculator implements MsrpPriceCalculatorInterface /** * @param array $msrpPriceCalculators */ - public function __construct(array $msrpPriceCalculators) + public function __construct(?array $msrpPriceCalculators = null) { - $this->msrpPriceCalculators = $this->getMsrpPriceCalculators($msrpPriceCalculators); + /* + * This is a workaround for the case of modules Magento_MsrpConfigurableProduct and Magento_MsrpGroupedProduct + * are disabled. + */ + if (\is_array($msrpPriceCalculators)) { + $this->msrpPriceCalculators = $this->getMsrpPriceCalculators($msrpPriceCalculators); + } } /**