• We just got this error for the first time which is causing recurring subscription payments to fail:

    06-08-2022 @ 15:37:37 - scheduled action 41038 (subscription payment) failed to finish processing due to the following error: Uncaught Error: Call to a member function get() on null in /nas/content/live/.../wp-content/plugins/wc-fields-factory/includes/wcff_order_handler.php:57
    Stack trace:
    #0 /nas/content/live/.../wp-content/plugins/wc-fields-factory/includes/wcff_product_fields.php(364): wcff_order_handler->insert(28883, Object(WC_Order_Item_Product), 27988)
    #1 /nas/content/live/.../wp-includes/class-wp-hook.php(307): wcff_product_fields->fields_order_meta_handler(28883, Object(WC_Order_Item_Product), 27988)
    #2 /nas/content/live/.../wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #3 /nas/content/live/.../wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #4 /nas/content/live/.../wp-content/plugins/woocommerce/includes/wc-order-item-functions.php(39): do_action('woocommerce_new...', 28883, Object(WC_Order_Item_Product), 27988)
    #5 /nas/content/live/.../wp-content/plugins/woocommerce-subscriptions/vendor/woocommerce/subscriptions-core/includes/wcs-order-functions.php(256): wc_add_order
    06-08-2022 @ 15:37:37 - action args: subscription_id: 15549

    Has this been seen before?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Saravana Kumar K

    (@mycholan)

    Hi, sorry for the trouble.

    Pls update the following line of code in the /wp-content/plugins/wc-fields-factory/includes/wcff_order_handler.php

    Replace the Line No 57 with the following.

    $template = "single-product";
    if (WC()->session) { 
        $template = WC()->session->get("wcff_current_template", "single-product");
    }

    This has already been applied to the latest release, right?

    Plugin Author Saravana Kumar K

    (@mycholan)

    Yes it is now, I have a silent update (without changing the plugin vertsion).

    Prior to Version 4 we haven’t used WC session object on order handler, but version Version 4 has some dependency on the WC session.

    In a normal order flow the wc session will be available in the order handler module, since it is from the cart -> checkout page.

    But here the subcription will happens in an arbitrary (as per schedule) time and the order will be prepared from the parent order, not from the cart object, hence no session.

    Anyway now the condition has been included before accessing WC Session in order handler.

    Plugin Contributor Sark

    (@sarkware)

    Yes, the fix is available with the latest version, I just did a silent update (without changing the version).

    From Version 4.X order handler is using WC session for some features, this is not an issue if the order is normal flow (Cart -> Checkout -> Order) since WC session will be there.

    In the case subscription the order will be arbitrary (as per schedule) and there won’t be Wc session, since subscription order will be created from a corresponding parent order (not from WC Cart) hence this issue.

    Now I have added condition for checking WC session.

    Thread Starter Jackson Whelan

    (@madjax)

    @sarkware thanks for the info, have made the change.

    Curious – why a silent update instead of a new bugfix version?

    Plugin Contributor Sark

    (@sarkware)

    Hi,
    At that time it was only one reported issue.
    So I thought instead of new version, silent update would do, but after that there are coulpe of issues, so that I had to release new update(s).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Subscriptions Failing – Uncaught Error: Call to a member function’ is closed to new replies.