epay-technology / woocommerce-payment-module

ePay WooCommerce Payment Module
0 stars 1 forks source link

Clash with Members plugin #1

Open jenslindberg opened 1 month ago

jenslindberg commented 1 month ago

When trying to edit user roles in the Members plugin, it triggers this error:

Fatal error: Uncaught Error: Call to a member function get_id() on bool in /XXX/wp-content/plugins/epay-payment/epay-payment.php on line 1275

My solution in epay-payment.php: Before, line 1271:

public function epay_payment_meta_boxes() {
            global $post;
            if ( ! isset( $post ) ) { //HPOS might be used
                $order    = wc_get_order();
                $order_id = $order->get_id();
            } else { ...

After:

        public function epay_payment_meta_boxes() {
            global $post;
            if ( ! isset( $post ) ) { //HPOS might be used
                $order    = wc_get_order();
                if ( ! $order ) {
                    return;
                }
                $order_id = $order->get_id();
            } else { ...
epay-mads commented 4 days ago

Thanks for your contribution, it's hereby added.