Title: PHP 8.1 Uncaught TypeError
Last modified: July 20, 2023

---

# PHP 8.1 Uncaught TypeError

 *  Resolved [gatespace](https://wordpress.org/support/users/gatespace/)
 * (@gatespace)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/)
 * Error logged with WP All Export version: 1.3.9 on PHP 8.1 server.
 *     ```wp-block-code
       Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /var/www/vhosts/example.com/wp-content/plugins/wp-all-export/src/App/Service/Addons/AddonService.php:50
       ```
   
 * Is there a newer version that fixes this?

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

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-16932699)
 * Hey [@gatespace](https://wordpress.org/support/users/gatespace/),
 * I’m sorry for the wait on this one.
 * Based on that error, it seems like some of the exports on the site are broken.
   When you look at the exports listed on the “Manage Exports” page, is the “Query”
   column empty for any of them?
 *  Thread Starter [gatespace](https://wordpress.org/support/users/gatespace/)
 * (@gatespace)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-16937786)
 * Thanks for the reply.
 * I had stopped the plugin on the server.
   When I activate the plugin to view the
   comments, I get the above error and cannot access the WordPress dashboard.
 *     ```wp-block-code
       [01-Aug-2023 08:40:36 UTC] PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /var/www/vhosts/example.com/wp-content/plugins/wp-all-export/src/App/Service/Addons/AddonService.php:50
       ```
   
 *  Thread Starter [gatespace](https://wordpress.org/support/users/gatespace/)
 * (@gatespace)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-16938239)
 * Additional Comments.
   I found a few records in php7.4 environment where the “Query”
   column is “Broken: please delete”.
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-16939886)
 * Hey [@gatespace](https://wordpress.org/support/users/gatespace/),
 * Okay, if it’s possible to change the site to PHP 7.4 temporarily, I would advise
   doing so & then removing any exports where “Broken: please delete” appears in
   the “Query” column. Once that’s done, you can switch it back to PHP 8.1.
 *  Thread Starter [gatespace](https://wordpress.org/support/users/gatespace/)
 * (@gatespace)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-16943017)
 * The server on which the plugin is installed is a shared server and cannot be 
   downgraded to PHP 7.4.
 * Also, manual deletion is time consuming due to the large number of records.
 * I would like the Fatal error in the plugin to be resolved.
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-16966902)
 * Hey [@gatespace](https://wordpress.org/support/users/gatespace/),
 * Thank you for your patience here.
 * In this case, we’d need to have more information to help resolve this for you.
   Please contact us over at our support portal: [https://www.wpallimport.com/support/](https://www.wpallimport.com/support/)–
   and add a link to this ticket in your message there.
 *  Thread Starter [gatespace](https://wordpress.org/support/users/gatespace/)
 * (@gatespace)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-16990688)
 * I sent a message through the support form, but it was not the response I was 
   expecting.
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-16992769)
 * Hey [@gatespace](https://wordpress.org/support/users/gatespace/),
 * My apologies for the frustration. Unfortunately, the only way we can help with
   this is if we have access to an environment where it’s happening. If it’s possible
   to give us access to one, please follow up in the email thread created via our
   support form and we’d be happy to advise further.
 *  Thread Starter [gatespace](https://wordpress.org/support/users/gatespace/)
 * (@gatespace)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-17014481)
 * The problem was then resolved through a support interaction.
   I will describe 
   the steps to reproduce the problem as a reference for other users.
 * 1. create a custom post type (test_post_type) and create a post
   2. export post
   type (test_post_type) data with WP All export3. delete the post type (test_post_type)
   4. in PHP7.4 the “Query” column with “Broken: please delete” is causing the error.
   Uncaught TypeError in PHP 8.1 if this record remains.

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

The topic ‘PHP 8.1 Uncaught TypeError’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-export/assets/icon-256x256.png?rev=2570162)
 * [WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel](https://wordpress.org/plugins/wp-all-export/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-export/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-export/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-export/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-export/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-export/reviews/)

## Tags

 * [PHP errors](https://wordpress.org/support/topic-tag/php-errors/)

 * 9 replies
 * 2 participants
 * Last reply from: [gatespace](https://wordpress.org/support/users/gatespace/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/php-8-1-uncaught-typeerror/#post-17014481)
 * Status: resolved