Support for PHP8
-
Dear Tickera team,
we are now running our WordPress instance on PHP8 and everything went well so far. However, we ecountered a minor hiccup with the
bridge-for-woocommerce
addon.The error we received was:
[20-Apr-2021 22:13:18 UTC] PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given in /var/srv/www.example.org/www/wp-content/plugins/bridge-for-woocommerce/bridge-for-woocommerce.php:1602
Hereby, we are submitting a patch you might want to integrate.
# diff -u /var/srv/www.example.org/www/wp-content/plugins/bridge-for-woocommerce/bridge-for-woocommerce.php.dist /var/srv/www.example.org/www/wp-content/plugins/bridge-for-woocommerce/bridge-for-woocommerce.php --- /var/srv/www.example.org/www/wp-content/plugins/bridge-for-woocommerce/bridge-for-woocommerce.php.dist 2021-04-21 11:06:12.680436457 +0200 +++ /var/srv/www.example.org/www/wp-content/plugins/bridge-for-woocommerce/bridge-for-woocommerce.php 2021-04-21 11:08:17.760759130 +0200 @@ -1772,7 +1772,7 @@ { $has_ticket = false; - if ( method_exists( $order, 'get_items' ) ) { + if ( (is_object($order) || is_string($order)) && method_exists( $order, 'get_items' ) ) { $items = $order->get_items(); if ( empty($items) ) { $items = ( is_cart() || is_checkout() ? WC()->cart->get_cart() : array() ); @@ -4066,4 +4066,4 @@ }
We hope this helps.
With kind regards,
Andreas.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Support for PHP8’ is closed to new replies.