Title: array_intersect_key() when processing the checkout form
Last modified: May 23, 2023

---

# array_intersect_key() when processing the checkout form

 *  Resolved [suzyo30](https://wordpress.org/support/users/suzyo30/)
 * (@suzyo30)
 * [3 years ago](https://wordpress.org/support/topic/array_intersect_key-when-processing-the-checkout-form/)
 * I am writing to seek your assistance regarding an error that I have encountered
   while using the “Flexible Checkout Fields” plugin. I believe your expertise and
   support can help me resolve this issue.
 * Error Details: Date/Time: 2023-05-23T09:13:10+00:00 Error Message: Uncaught TypeError:
   array_intersect_key(): Argument #1 ($array) must be of type array, null given
   Plugin: Flexible Checkout Fields File: /srv/htdocs/wp-content/plugins/woocommerce/
   includes/class-wc-countries.php Line: 1571
 * Stack Trace:
    - /srv/htdocs/wp-content/plugins/woocommerce/includes/class-wc-countries.php(
      1571)
    - /srv/htdocs/wp-content/plugins/flexible-checkout-fields/classes/plugin.php(
      604)
    - /srv/htdocs/wp-content/plugins/flexible-checkout-fields/classes/plugin.php(
      572)
    - /srv/htdocs/wp-content/plugins/flexible-checkout-fields/classes/display-options.
      php(149)
    - /srv/htdocs/wp-content/plugins/flexible-checkout-fields/classes/display-options.
      php(456)
    - /srv/htdocs/wp-content/plugins/flexible-checkout-fields/classes/display-options.
      php(447)
    - …
 * Description: When processing the checkout, I encountered the above-mentioned 
   error message. It appears that the error originates from the “Flexible Checkout
   Fields” plugin, specifically within the “restore_default_city_validation” function.
   The issue seems to be related to the handling of a null value when calling the“
   array_intersect_key()” function in the “WC_Countries” class.
 * Request: I kindly request your guidance and assistance in resolving this error.
   After analyzing the code, I made some modifications to handle the null value,
   but I haven’t been successful in resolving the issue. I believe your expertise
   and insights would be invaluable in identifying the root cause and providing 
   a suitable solution.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Farray_intersect_key-when-processing-the-checkout-form%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [rzepsen](https://wordpress.org/support/users/rzepsen/)
 * (@rzepsen)
 * [3 years ago](https://wordpress.org/support/topic/array_intersect_key-when-processing-the-checkout-form/#post-16761068)
 * Hello [@suzyo30](https://wordpress.org/support/users/suzyo30/)
 * It seems that the problem may be related to some other plugin used in your shop.
   It seems that the woocommerce_get_country_locale filter activates before the 
   actions of our plugin and the data is modified to null
 * Have you tried to isolate the issue? Please disable all third-party plugins in
   your WordPress and try again. 
 *  Plugin Support [Tomasz WP Desk](https://wordpress.org/support/users/tomaszwp/)
 * (@tomaszwp)
 * [3 years ago](https://wordpress.org/support/topic/array_intersect_key-when-processing-the-checkout-form/#post-16779762)
 * I am marking this topic as resolved as we have not received any new replies. 
   Please let us know if you need our help again.

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

The topic ‘array_intersect_key() when processing the checkout form’ is closed to
new replies.

 * ![](https://ps.w.org/flexible-checkout-fields/assets/icon-256x256.gif?rev=2522628)
 * [Flexible Checkout Fields for WooCommerce - WooCommerce Checkout Manager](https://wordpress.org/plugins/flexible-checkout-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-checkout-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-checkout-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-checkout-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-checkout-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-checkout-fields/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Tomasz WP Desk](https://wordpress.org/support/users/tomaszwp/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/array_intersect_key-when-processing-the-checkout-form/#post-16779762)
 * Status: resolved