• Resolved Jamie Burchell

    (@jamieburchell)


    Getting this error when saving products:

    An error of type E_ERROR was caused in line 1057 of the file /var/www/web/app/plugins/stripe-payments/admin/includes/class-asp-admin-product-meta-boxes.php. Error message: Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array, null given in /var/www/web/app/plugins/stripe-payments/admin/includes/class-asp-admin-product-meta-boxes.php:1057
    
    Stack trace:
    
    #0 /var/www/web/app/plugins/stripe-payments/admin/includes/class-asp-admin-product-meta-boxes.php(1057): array_values(NULL)
    
    #1 /var/www/web/wp/wp-includes/class-wp-hook.php(308): ASP_Admin_Product_Meta_Boxes->save_product_handler(24458, Object(WP_Post), true)
    
    #2 /var/www/web/wp/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
    
    #3 /var/www/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
    
    #4 /var/www/web/wp/wp-includes/post.php(4704): do_action('save_post_asp-p...', 24458, Object(WP_Post), true)
    
    #5 /var/www/web/wp/wp-includes/post.php(4817): wp_insert_post(Array, false, true)
    
    #6 /var/www/web/wp/wp-admin/includes/post.php(439): wp_update_post(Array)
    
    #7 /var/www/web/wp/wp-admin/post.php(227): edit_post()
    
    #8 {main}
    
      thrown
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, did you forget to enter any value when you created the product? Please check the following instructions. Let me know if they help you.

    https://s-plugins.com/creating-product-stripe-payments-plugin/

    Kind regards.

    Thread Starter Jamie Burchell

    (@jamieburchell)

    I wasn’t the one entering the product so I can’t say – I just received the crash email. Even if they didn’t, I would expect the plugin to handle the null properly.

    Plugin Support mbrsolution

    (@mbrsolution)

    I was not aware that you received an email with the described error. Please carry out the following troubleshooting steps.

    1st – Enable debug mode. The following instructions can help.

    https://s-plugins.com/using-the-debug-log-to-solve-issues-on-a-site/

    2nd – Carry out a test transaction. The following instructions can help.

    https://s-plugins.com/complete-test-transaction-using-stripe-payments-plugin/

    3rd – Carry out a plugin/theme conflict test. The following instructions can help. If there was an issue in the steps above this step might help you find out if there is a conflict with one of your plugins and or your theme.

    https://s-plugins.com/forums/topic/test-for-plugin-and-theme-conflict-before-posting-an-issue-or-a-bug/

    Report back with any findings.

    Kind regards.

    Thread Starter Jamie Burchell

    (@jamieburchell)

    Hi @mbrsolution

    The error is caused by passing NULL to array_values, which expects an array. In this case, the variable is NULL because the POST key asp-variation-names was missing from the payload. This part of the code lives is in the save_product_handler, so is unrelated to putting through transactions and I can confirm this is not caused by plugin conflicts.

    I’d be grateful if you could please pass this on to the devs.

    Many thanks

    Plugin Support mbrsolution

    (@mbrsolution)

    Thank you for providing more information. I have submitted a message to the developers to investigate further your findings.

    Kind regards.

    Plugin Support mbrsolution

    (@mbrsolution)

    Hi, have you received any more error messages? Are you also using variation control in your product? Can you share the URL with the payment button?

    Kind regards.

    Thread Starter Jamie Burchell

    (@jamieburchell)

    Hi @mbrsolution

    I’ve not seen any further errors come my way, but that may be because nobody has been in the admin adding new products. You are correct that product variations are being used.

    Thanks
    Jamie

    Plugin Support mbrsolution

    (@mbrsolution)

    but that may be because nobody has been in the admin adding new products. You are correct that product variations are being used.

    Could the error have occurred because who ever was setting up the variation control did not fill out the fields correctly?

    Regards.

    Thread Starter Jamie Burchell

    (@jamieburchell)

    Could the error have occurred because who ever was setting up the variation control did not fill out the fields correctly?

    Yes, it’s possible. In that case I would expect a validation message and not a PHP error.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array’ is closed to new replies.