You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found one bug when visiting a single order in wp-admin (.../wp-admin/admin.php?page=wc-orders&action=edit&id=NN) while using WooCommerce's high performance order storage (HPOS).
PHP Fatal error: Uncaught TypeError: swedbank_pay_get_payment_method(): Argument #1 ($order) must be of type WC_Order, bool given, called in [...]/plugins/swedbank-pay-payment-menu/includes/class-swedbank-pay-admin.php on line 366
Hey,
I'm trying out this new plugin for a customer that currently uses https://github.com/SwedbankPay/swedbank-pay-woocommerce-payments/. Am I correct to assume that this plugin is the recommended one to use going forward?
Found one bug when visiting a single order in wp-admin (
.../wp-admin/admin.php?page=wc-orders&action=edit&id=NN
) while using WooCommerce's high performance order storage (HPOS).PHP Fatal error: Uncaught TypeError: swedbank_pay_get_payment_method(): Argument #1 ($order) must be of type WC_Order, bool given, called in [...]/plugins/swedbank-pay-payment-menu/includes/class-swedbank-pay-admin.php on line 366
This is easily fixed by checking that
$order !== false
here https://github.com/SwedbankPay/swedbank-pay-woocommerce-paymentmenu/blob/main/includes/class-swedbank-pay-admin.php#L365But the underlying issue is that this method https://github.com/SwedbankPay/swedbank-pay-woocommerce-paymentmenu/blob/main/includes/class-swedbank-pay-admin.php#L213 uses the global
$post_id
which is not set when using HPOS. Using the following code instead of relying on$post_id
seems to work for both the old order system (usingwp_posts
) and HPOS.The text was updated successfully, but these errors were encountered: