• Resolved tgd

    (@tungstendigital)


    Hi, some of my clients customers are getting a spinning wheel when trying to click through to Paypal. It’s weird because it doesn’t appear to happen to everyone. Sometimes they seem to try again and it works. Whenever this issue crops up, there is a fatal error logged in the wc log files. This is as follows…
    We use the AngelEye paypal plugin as we have some extra functionality to do with payments, however the address all happens before the redirect and it does seem to be an issue with a function call in your plugin.

    2022-06-09T23:33:39+00:00 CRITICAL Uncaught Error: Call to undefined method WC_Customer::get_posted_data() in /home/customer/www/*****/public_html/wp-content/plugins/woo-address-book/includes/class-wc-address-book.php:869
    Stack trace:
    #0 /home/customer/www/*****/public_html/wp-includes/class-wp-hook.php(307): WC_Address_Book->woocommerce_checkout_update_customer_data(false, Object(WC_Customer))
    #1 /home/customer/www/*****/public_html/wp-includes/plugin.php(191): WP_Hook->apply_filters(true, Array)
    #2 /home/customer/www/*****/public_html/wp-content/plugins/paypal-for-woocommerce/angelleye-includes/express-checkout/class-wc-gateway-paypal-express-request-angelleye.php(1654): apply_filters('woocommerce_che...', true, Object(WC_Customer))
    #3 /home/customer/www/*****/public_html/wp-content/plugins/paypal-for-woocommerce/classes/wc-gateway-paypal-express-angelleye-v1.php(2317): WC_Gateway_PayPal_Express_Request_AngellEYE->angelleye_process_customer(55 in /home/customer/www/*****/public_html/wp-content/plugins/woo-address-book/includes/class-wc-address-book.php on line 869

    Many thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Matt Harrison

    (@matt-h-1)

    Hi,

    The error here is the undefined method on WC_Customer::get_posted_data(), however that part of the address book plugin expects it to be a WC_Checkout object and not a WC_Customer object as that is what the woocommerce_checkout_update_customer_data filter passes through in WooCommerce core.

    The actual filter defined in WooCommerce can be seen here: https://github.com/woocommerce/woocommerce/blob/8d281241a9388e8c7dbfc1fa0da0d9d1443c72bf/plugins/woocommerce/includes/class-wc-checkout.php#L1067

    Looking at the code for the AngellEye plugin they are calling the filter with WC()->customer with this code:

    
    if ($first_name && apply_filters('woocommerce_checkout_update_customer_data', true, WC()->customer)) {
    

    They should be passing a WC_Checkout object there and not a WC_Customer object.

    You should contact AngellEye about this (and you can send the link to this thread) as this would need to be solved on their end since they are using the filter from WooCommerce core incorrectly.

    Matt

Viewing 1 replies (of 1 total)
  • The topic ‘Sporadic fatal error occuring’ is closed to new replies.