Title: Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array
Last modified: July 17, 2023

---

# Uncaught TypeError: array_values(): Argument #1 ($array) must be of type array

 *  Resolved [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/)
 * Getting this error when saving products:
 *     ```wp-block-code
       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](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16904891)
 * 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/](https://s-plugins.com/creating-product-stripe-payments-plugin/)
 * Kind regards.
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16905606)
 * 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](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16907987)
 * 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/](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/](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/](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](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16908687)
 * Hi [@mbrsolution](https://wordpress.org/support/users/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](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16909401)
 * Thank you for providing more information. I have submitted a message to the developers
   to investigate further your findings.
 * Kind regards.
 *  Plugin Support [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16979357)
 * 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](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16982387)
 * Hi [@mbrsolution](https://wordpress.org/support/users/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](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16984469)
 * > 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](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16988084)
 * > 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.

 * ![](https://ps.w.org/stripe-payments/assets/icon-128x128.png?rev=2705524)
 * [Accept Stripe Payments](https://wordpress.org/plugins/stripe-payments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stripe-payments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stripe-payments/)
 * [Active Topics](https://wordpress.org/support/plugin/stripe-payments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stripe-payments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stripe-payments/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-array_values-argument-1-array-must-be-of-type-array/#post-16988084)
 * Status: resolved