alma / alma-monthlypayments-magento2

Magento 2 Payment Gateway integration for Alma
Other
6 stars 9 forks source link

Critical Error on Product page > issue with registry usage #63

Closed thacac closed 2 years ago

thacac commented 2 years ago

On some configurable products, page goes to error with that log : [2022-09-22T11:47:35.244653+00:00] main.CRITICAL: Error: Call to a member function getId() on null in /var/wwwxxxxx/vendor/alma/alma-monthlypayments-magento2/Block/Catalog/Product/View.php:96 Stack trace:

0 /var/www/xxxxxx/vendor/alma/alma-monthlypayments-magento2/Block/Catalog/Product/View.php(85): Alma\MonthlyPayments\Block\Catalog\Product\View->getProduct()

Here, line 96, callling to registry fails Should get it from context $this->product = $this->context->getRegistry()->registry('product'); https://github.com/alma/alma-monthlypayments-magento2/blob/master/Block/Catalog/Product/View.php