woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
62 stars 47 forks source link

Fatal error when WooPayments 8.0 and PayPal Payments 2.7.1+ are active at the same time #2481

Open aleksandrx opened 1 month ago

aleksandrx commented 1 month ago

Describe the Bug

PHP Fatal error: Uncaught Error: Call to undefined function WooCommerce\PayPalCommerce\Blocks\wc_terms_and_conditions_page_id() in /.../wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-blocks/extensions.php:47

To Reproduce

After updating the plugin to version 2.8.2, the site breaks.

jeanpaulsparrow commented 1 month ago

It seems to conflict with wooCommerce-payments.

clusterzx commented 1 month ago

Since the new update my site also got bricked. Only way right now is disable plugin.

Ein Fehler vom Typ E_ERROR wurde in der Zeile 47 der Datei /var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-blocks/extensions.php verursacht. Fehlermeldung: Uncaught Error: Call to undefined function WooCommerce\PayPalCommerce\Blocks\wc_terms_and_conditions_page_id() in /var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-blocks/extensions.php:47 Stack trace: #0 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CompositeCachingServiceProvider.php(132): WooCommerce\PayPalCommerce\Blocks\BlocksModule->WooCommerce\PayPalCommerce\Blocks\{closure}() #1 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CompositeCachingServiceProvider.php(131): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeCachingServiceProvider->WooCommerce\PayPalCommerce\Vendor\Dhii\Container\{closure}() #2 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CompositeCachingServiceProvider.php(131): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeCachingServiceProvider->WooCommerce\PayPalCommerce\Vendor\Dhii\Container\{closure}() #3 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CompositeCachingServiceProvider.php(131): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeCachingServiceProvider->WooCommerce\PayPalCommerce\Vendor\Dhii\Container\{closure}() #4 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/DelegatingContainer.php(144): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeCachingServiceProvider->WooCommerce\PayPalCommerce\Vendor\Dhii\Container\{closure}() #5 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/DelegatingContainer.php(74): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->invokeExtension() #6 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/services.php(318): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->get() #7 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/DelegatingContainer.php(117): WooCommerce\PayPalCommerce\WcGateway\WCGatewayModule::WooCommerce\PayPalCommerce\WcGateway\{closure}() #8 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/DelegatingContainer.php(56): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->invokeFactory() #9 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/services.php(77): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->get() #10 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/DelegatingContainer.php(117): WooCommerce\PayPalCommerce\WcGateway\WCGatewayModule::WooCommerce\PayPalCommerce\WcGateway\{closure}() #11 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/DelegatingContainer.php(56): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->invokeFactory() #12 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CompositeContainer.php(53): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\DelegatingContainer->get() #13 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CachingContainer.php(61): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CompositeContainer->get() #14 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CachingContainer.php(161): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->WooCommerce\PayPalCommerce\Vendor\Dhii\Container\{closure}() #15 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CachingContainer.php(128): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->invokeGenerator() #16 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/lib/packages/Dhii/Container/CachingContainer.php(62): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->getCached() #17 /var/www/html/wp-content/plugins/woocommerce-paypal-payments/modules/ppcp-wc-gateway/src/WCGatewayModule.php(511): WooCommerce\PayPalCommerce\Vendor\Dhii\Container\CachingContainer->get() #18 /var/www/html/wp-includes/class-wp-hook.php(324): WooCommerce\PayPalCommerce\WcGateway\WCGatewayModule::WooCommerce\PayPalCommerce\WcGateway\{closure}() #19 /var/www/html/wp-includes/plugin.php(205): WP_Hook->apply_filters() #20 /var/www/html/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(94): apply_filters() #21 /var/www/html/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(76): WC_Payment_Gateways->init() #22 /var/www/html/wp-content/plugins/woocommerce/includes/class-wc-payment-gateways.php(49): WC_Payment_Gateways->__construct() #23 /var/www/html/wp-content/plugins/woocommerce-payments/includes/class-wc-payments-features.php(271): WC_Payment_Gateways::instance() #24 /var/www/html/wp-content/plugins/woocommerce-payments/includes/class-wc-payments.php(1583): WC_Payments_Features::is_woopay_direct_checkout_enabled() #25 /var/www/html/wp-content/plugins/woocommerce-payments/includes/class-wc-payments.php(599): WC_Payments::maybe_init_woopay_direct_checkout() #26 /var/www/html/wp-includes/class-wp-hook.php(324): WC_Payments::{closure}() #27 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #28 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action() #29 /var/www/html/wp-settings.php(630): do_action() #30 /var/www/html/wp-config.php(98): require_once('...') #31 /var/www/html/wp-load.php(50): require_once('...') #32 /var/www/html/wp-blog-header.php(13): require_once('...') #33 /var/www/html/index.php(17): require('...') #34 {main} thrown

InpsydeNiklas commented 1 month ago

Hi everyone, thank you for reporting this issue, and we apologize for the inconvenience.

The code causing this error has been part of the PayPal Payments plugin for a few months. The error is due to a compatibility problem with the latest WooPayments 8.0 update. You can follow the progress on this issue here: https://github.com/Automattic/woocommerce-payments/issues/9195

To work around this error, you have two options:

Both of these options should resolve the error for the time being. Thank you for your patience as we work to resolve this issue.

InpsydeNiklas commented 1 month ago

Hi folks, a new patch update for the WooPayments plugin (8.0.1) was just released: https://github.com/Automattic/woocommerce-payments/releases/tag/8.0.1

8.0.1 – 2024-07-31 Fix – Reverts changes related to Direct Checkout that broke the PayPal extension.

This new version should resolve the error even when using it together the regular PayPal Payments 2.8.2 version instead of the workaround package linked above. Please update your WooPayments plugin to the latest version and let us know if any problems with the PayPal Payments plugin remain. Thank you!