Title: PHP Fatal error: Uncaught TypeError
Last modified: May 18, 2026

---

# PHP Fatal error: Uncaught TypeError

 *  Resolved [bluedogranch](https://wordpress.org/support/users/bluedogranch/)
 * (@bluedogranch)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/)
 * Hi,
 * I get this fatal error in Version 4.27.0, but only when using the Relevanssi 
   admin option “Use Relevanssi for admin searches” and only when searching Events
   in admin when using [https://wordpress.org/plugins/the-events-calendar/](https://wordpress.org/plugins/the-events-calendar/)
 * I **do not** get the fatal error when using “Use Relevanssi for admin searches”
   and searching WordPress posts, pages, etc., in admin.
 * So I don’t know where to look for a fix 🙂
 * Thanks!
 *     ```wp-block-code
       PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /html/wp-content/plugins/rel evanssi/lib/search.php:1243Stack trace:#0 /html/wp-content/plugins/relevanssi/lib/search.php(1769): relevanssi_meta_query_from_query_vars(Object(WP_Query))#1 /html/wp-content/plugins/relevanssi/lib/search.php(949): relevanssi_compile_common_args(Object(WP_Query))#2 /html/wp-content/plugins/relevanssi/lib/search.php(612): relevanssi_compile_search_args(Object(WP_Query), 'land legacy')#3 /html/wp-content/plugins/relevanssi/lib/search.php(88): relevanssi_do_query(Object(WP_Query))#4 /html/wp-includes/class-wp-hook.php(341): relevanssi_query(NULL, Object(WP_Query))#5 /html/wp-includes/plugin.php(256): WP_Hook->apply_filters(NULL, Array)#6 /html/wp-includes/class-wp-query.php(3226): apply_filters_ref_array('posts_pre_query', Array)#7 /html/wp-includes/class-wp-query.php(3958): WP_Query->get_posts()#8 /html/wp-includes/class-wp.php(704): WP_Query->query(Array)#9 /html/wp-includes/class-wp.php(824): WP->query_posts()#10 /html/wp-includes/functions.php(1343): WP->main(Array)#11 /html/wp-admin/includes/post.php(1319): wp(Array)#12 /html/wp-admin/includes/class-wp-posts-list-table.php(165): wp_edit_posts_query()#13 /html/wp-admin/edit.php(235): WP_Posts_List_Table->prepare_items()#14 {main}  thrown in /html/wp-content/plugins/relevanssi/lib/search.php on line 1243
       ```
   

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

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [2 weeks, 3 days ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18911718)
 * I happen to have The Events Calendar. I tried replicating this problem, but can’t:
   the admin search works fine.
 * This error comes from the way the meta queries are handled. Do you have any custom
   filtering code related to meta queries?
 *  Thread Starter [bluedogranch](https://wordpress.org/support/users/bluedogranch/)
 * (@bluedogranch)
 * [2 weeks, 2 days ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18912387)
 * Thanks! I don’t know about any custom queries; where would I look? I am using
   Twig [https://flyntwp.com/](https://flyntwp.com/) for a theme.
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [2 weeks, 2 days ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18912662)
 * If you don’t know, then you probably don’t have any. It’s something you probably
   should’ve added yourself to a code snippet or in the theme functions.php.
 * However, without knowing what the meta query looks like, there’s little I can
   do to help. I don’t know how there would be a meta query in the first place.
 *  Thread Starter [bluedogranch](https://wordpress.org/support/users/bluedogranch/)
 * (@bluedogranch)
 * [2 weeks, 2 days ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18912985)
 * Thanks! I know this is difficult. I found this; it might be related:
 *     ```wp-block-code
       /wp-content/plugins/the-events-calendar/src/Events/Custom_Tables/V1/WP_Query/Custom_Tables_Query.php/*** Replaces the WP_Meta_Query instance built in the WP_Query::get_posts method with an instance of* the WP_Meta_Query extension that will redirect some custom fields queries to the plugin custom tables.** This method is expected to be hooked to the posts_search hook in the WP_Query::get_posts method.* The method will not change** @since 6.0.0** @param  string    $search    The WHERE clause as produced by the WP_Query instance.* @param  WP_Query  $wp_query  A reference to the WP_Query instance whose search WHERE clause is currently being*                              filtered.** @return string The WHERE clause as produced by the WP_Query instance, untouched by the method.*/public function replace_meta_query( $search, $wp_query ) {if ( $wp_query !== $this ) {// Only target the class own instance.return $search;}
       ```
   
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [2 weeks, 2 days ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18913016)
 * Yes, looks like The Events Calendar does something with the meta query. But why
   it does it on your site but not on my site? The Events Calendar floods my error
   logs with deprecation notices when run with PHP 8.5, but doesn’t cause any fatal
   errors related to meta queries in the admin search.
 * But if this is the only place where the problem happens, the solution is easy:
   disable Relevanssi in the admin search, and use the Relevanssi Admin Search to
   do the admin searching.
 *  Thread Starter [bluedogranch](https://wordpress.org/support/users/bluedogranch/)
 * (@bluedogranch)
 * [2 weeks, 1 day ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18913771)
 * Thanks, I disabled Relevanssi in the admin search, but what do you mean by “use
   the Relevanssi Admin Search to do the admin searching”?
 * [https://postimg.cc/mP6wyRhZ](https://postimg.cc/mP6wyRhZ)
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [2 weeks, 1 day ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18914172)
 * There’s a Relevanssi search in your admin menu at Dashboard > Admin search.
 *  Thread Starter [bluedogranch](https://wordpress.org/support/users/bluedogranch/)
 * (@bluedogranch)
 * [1 week, 4 days ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18917599)
 * Ah, thanks!

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-fatal-error-uncaught-typeerror-20%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [bluedogranch](https://wordpress.org/support/users/bluedogranch/)
 * Last activity: [1 week, 4 days ago](https://wordpress.org/support/topic/php-fatal-error-uncaught-typeerror-20/#post-18917599)
 * Status: resolved