• Resolved hhgk

    (@hhgk)


    Hi,

    I’m using your plugin “Mailchimp for WooCommerce” on my client’s website. This site uses “Woocommerce” together with “WooCommerce Subscriptions”. With the last few subscription renewal payments I got the following error:

    7-13-2023 @ 17:25:50 - scheduled action 70676 (subscription payment) failed to finish processing due to the following error: Uncaught ArgumentCountError: Too few arguments to function MailChimp_Service::handleOrderUpdate(), 1 passed in /wp-includes/class-wp-hook.php on line 308 and exactly 2 expected in /wp-content/plugins/mailchimp-for-woocommerce/includes/class-mailchimp-woocommerce-service.php:511 Stack trace: #0 /wp-includes/class-wp-hook.php(308): MailChimp_Service->handleOrderUpdate() #1 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #2 /wp-includes/plugin.php(517): WP_Hook->do_action() #3 /wp-content/plugins/woocommerce-subscriptions/includes/data-stores/class-wcs-subscription-data-store-cpt.php(189): do_action() #4 /wp-content/plugins/woocommerce/includes/class-wc-data-store.php(196): WCS_Subscription_Data_Store_CPT->update() #5 /wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(212): WC_Data_Store->update() #6 /wp-content/plugins/woocommerce/includes/class-wc-order.php(244): WC_Abstract_Order->save() #7 /wp-content/plugins/woocommerce-subscriptions/includes/class-wc-subscription.php(529): WC_Order->save() #8 /wp-content/plugins/woocommerce-subscriptions/includes/class-wc-subscriptions-manager.php(113): WC_Subscription->update_status() #9 /wp-content/plugins/woocommerce-subscriptions/includes/class-wc-subscriptions-manager.php(89): WC_Subscriptions_Manager::process_renewal() #10 /wp-includes/class-wp-hook.php(308): WC_Subscriptions_Manager::prepare_renewal() #11 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #12 /wp-includes/plugin.php(565): WP_Hook->do_action() #13 /wp-content/plugins/imagify/inc/Dependencies/ActionScheduler/classes/actions/ActionScheduler_Action.php(43): do_action_ref_array() #14 /wp-content/plugins/imagify/inc/Dependencies/ActionScheduler/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php(65): ActionScheduler_Action->execute() #15 /wp-content/plugins/imagify/inc/Dependencies/ActionScheduler/classes/ActionScheduler_QueueRunner.php(166): ActionScheduler_Abstract_QueueRunner->process_action() #16 /wp-content/plugins/imagify/inc/Dependencies/ActionScheduler/classes/ActionScheduler_QueueRunner.php(136): ActionScheduler_QueueRunner->do_batch() #17 /wp-includes/class-wp-hook.php(308): ActionScheduler_QueueRunner->run() #18 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #19 /wp-includes/plugin.php(565): WP_Hook->do_action() #20 /wp-cron.php(188): do_action_ref_array() #21 {main} thrown 07-13-2023 @ 17:25:50 - action args: subscription_id: 8010

    I had to deactivate your plugin.

    Can you please help me to correct this problem so that I can activate your plugin again?

    Regards,

    Holger

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support khungate

    (@khungate)

    Hi @hhgk, thanks for reaching out. Can you confirm a few things for us?

    • What plugin version are you using?
    • Can you enable Remote Diagnostics on your site? You can do this by going to the Settings tab and checking the box for Remote Diagnostics.

    We look forward to hearing back from you.

    Thanks!

    Thread Starter hhgk

    (@hhgk)

    Hi,

    The plugin version is 3.1.

    I’m sorry but this is a live site. I can not reactivate your plugin before the problem is solved. We also have a DEV version, but at this version the automatic subscription payment system is deactivated.

    It would be great if you could find an other way to correct this problem. At least prevent your plugin from interfering with automatic payments.

    Regards,

    Holger

    Plugin Author ryanhungate

    (@ryanhungate)

    @hhgk by chance are you using PHP FPM on this machine? You might need to restart PHP to get the new code changes to take place. The second argument of that function is NULLABLE so it shouldn’t be erroring out like that.

    We did actually see that the same thing happens on “order created” which we have a patch currently in progress that will be released in 3.2 and that should be coming up soon as well that you could wait for as well.

    If you need to patch this immediately, I can assist personally with a code snippet but would require a plugin edit ( short term solution ).

    The function in that file class-mailchimp-woocommerce-service.php on line 512, you should see this now:

    /**
     * @param $order_id
     * @param $order
     */
    public function handleOrderUpdate($order_id, $order = null) {
    	if (empty($order)) $order = MailChimp_WooCommerce_HPOS::get_order($order_id);
    	mailchimp_log('handleOrderUpdate', 'order_status');
    	$this->handleOrderSaved($order_id, $order, true);
    }

    The same thing needs to be done inside the order creation function which is scheduled to be released in 3.2

    /**
     * @param $order_id
     * @param $order
     */
    public function handleOrderCreate($order_id, $order = null) {
    	if (empty($order)) $order = MailChimp_WooCommerce_HPOS::get_order($order_id);
        $this->handleOrderSaved($order_id, $order, false);
    }

    Sorry for the issues, we’re staying on top of things and will make sure this issue is patched asap.

    @ryanhungate — is this an issue only for WooCommerce Subscriptions-related orders, or is this an issue for all WooCommerce orders?

    I use WooCommerce, but not WooCommerce Subscriptions, so just trying to figure out if I should be proactively editing plugin code, too, or not. ??

    Plugin Author ryanhungate

    (@ryanhungate)

    @hastibe thanks for reaching out. This seems to be an edge case, but we’re going to push out an update that should work for anyone else that might be firing that same hook without the proper arguments.

    It’s still in the QA process but shouldn’t be too long before that gets released. If you find yourself in a spot where it needs to be fixed right away please let us know and we can assist with that.

    Plugin Support khungate

    (@khungate)

    Hi @hhgk, thanks for your patience. This issue should be resolved in the latest version of the plugin (v3.2). Don’t hesitate to reach back out if you need any further assistance.

    We appreciate you using the plugin. If you’re happy with this integration, please consider leaving a?5-star review. Your feedback helps other WooCommerce customers find this integration and helps support future development.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Too few arguments to function MailChimp_Service::handleOrderUpdate()’ is closed to new replies.