If there is no configuration value in the database for payment/buckaroo_magento2_applepay/available_buttons an error will appear on the product page. TypeError: in_array(): Argument #2 ($haystack) must be of type array, bool given in Block/Catalog/Product/View/Applepay.php:66
Steps to reproduce:
Make sure there is no value for the configuration payment/buckaroo_magento2_applepay/available_buttons in the database
Go to a product page
An error is displayed
Cause of the issue:
It's because of the changes in commit 385f7d16924d37baec581e63934207cf2cf59844, file Block/Catalog/Product/View/Applepay.php, function canShowButton($page). Here the check $this->applepayConfigProvider->getAvailableButtons() has been removed. If there is no configuration value in the database, false is returned. However, an in_array() call is executed on this.
Solution:
Add the check again. See screenshot below.
If there is no configuration value in the database for
payment/buckaroo_magento2_applepay/available_buttons
an error will appear on the product page.TypeError: in_array(): Argument #2 ($haystack) must be of type array, bool given in Block/Catalog/Product/View/Applepay.php:66
Steps to reproduce:
payment/buckaroo_magento2_applepay/available_buttons
in the databaseCause of the issue: It's because of the changes in commit
385f7d16924d37baec581e63934207cf2cf59844
, fileBlock/Catalog/Product/View/Applepay.php
, functioncanShowButton($page)
. Here the check$this->applepayConfigProvider->getAvailableButtons()
has been removed. If there is no configuration value in the database, false is returned. However, an in_array() call is executed on this.Solution: Add the check again. See screenshot below.
Version: