Title: Fatal errors object_id
Last modified: November 8, 2023

---

# Fatal errors object_id

 *  [tuomonurkkala](https://wordpress.org/support/users/tuomonurkkala/)
 * (@tuomonurkkala)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/fatal-errors-object_id-2/)
 * Hi there,
 * I am having problems with my site and I am getting this fatal error on my woocommerce
   logs:
 *     ```wp-block-code
       2023-11-08T08:24:12+00:00 CRITICAL Uncaught Error: Attempt to assign property "object_id" on bool in /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php:1118
       Stack trace:
       #0 /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php(817): WP_Term_Query->populate_terms()
       #1 /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php(308): WP_Term_Query->get_terms()
       #2 /home2/sukkianet/public_html/wp-includes/taxonomy.php(1308): WP_Term_Query->query()
       #3 /home2/sukkianet/public_html/wp-includes/taxonomy.php(2268): get_terms()
       #4 /home2/sukkianet/public_html/wp-includes/taxonomy.php(3781): wp_get_object_terms()
       #5 /home2/sukkianet/public_html/wp-includes/post.php(7796): update_object_term_cache()
       #6 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3317): _prime_post_caches()
       #7 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3800): WP_Query->get_posts()
       #8 /home2/sukkianet/public_html/wp-includes/class-wp.php(662): WP_Query->query()
       #9 /home2/sukkianet/public_html/wp-includes/class-wp.php(782): WP->query_posts()
       #10 /home2/sukkianet/public_html/wp-includes/functions.php(1335): WP->main()
       #11 /home2/sukkianet/public_html/wp-blog-header.php(16): wp()
       #12 /home2/sukkianet/public_html/index.php(17): require('/home2/sukkiane...')
       #13 {main}
         thrown tässä /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php rivillä 1118
       ```
   
 * Best Regards,
 * Tuomo Nurkkala
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-errors-object_id-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [tuomonurkkala](https://wordpress.org/support/users/tuomonurkkala/)
 * (@tuomonurkkala)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/fatal-errors-object_id-2/#post-17184419)
 * Now it is giving me even a longer list of fatal errors:
 *     ```wp-block-code
       2023-11-08T08:24:12+00:00 CRITICAL Uncaught Error: Attempt to assign property "object_id" on bool in /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php:1118
       Stack trace:
       #0 /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php(817): WP_Term_Query->populate_terms()
       #1 /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php(308): WP_Term_Query->get_terms()
       #2 /home2/sukkianet/public_html/wp-includes/taxonomy.php(1308): WP_Term_Query->query()
       #3 /home2/sukkianet/public_html/wp-includes/taxonomy.php(2268): get_terms()
       #4 /home2/sukkianet/public_html/wp-includes/taxonomy.php(3781): wp_get_object_terms()
       #5 /home2/sukkianet/public_html/wp-includes/post.php(7796): update_object_term_cache()
       #6 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3317): _prime_post_caches()
       #7 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3800): WP_Query->get_posts()
       #8 /home2/sukkianet/public_html/wp-includes/class-wp.php(662): WP_Query->query()
       #9 /home2/sukkianet/public_html/wp-includes/class-wp.php(782): WP->query_posts()
       #10 /home2/sukkianet/public_html/wp-includes/functions.php(1335): WP->main()
       #11 /home2/sukkianet/public_html/wp-blog-header.php(16): wp()
       #12 /home2/sukkianet/public_html/index.php(17): require('/home2/sukkiane...')
       #13 {main}
         thrown tässä /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php rivillä 1118
   
       2023-11-08T08:57:20+00:00 CRITICAL Uncaught Error: Attempt to assign property "object_id" on bool in /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php:1134
       Stack trace:
       #0 /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php(828): WP_Term_Query->populate_terms()
       #1 /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php(311): WP_Term_Query->get_terms()
       #2 /home2/sukkianet/public_html/wp-includes/taxonomy.php(1332): WP_Term_Query->query()
       #3 /home2/sukkianet/public_html/wp-includes/taxonomy.php(2291): get_terms()
       #4 /home2/sukkianet/public_html/wp-includes/taxonomy.php(3804): wp_get_object_terms()
       #5 /home2/sukkianet/public_html/wp-includes/post.php(7804): update_object_term_cache()
       #6 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3334): _prime_post_caches()
       #7 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3824): WP_Query->get_posts()
       #8 /home2/sukkianet/public_html/wp-includes/class-wp.php(696): WP_Query->query()
       #9 /home2/sukkianet/public_html/wp-includes/class-wp.php(816): WP->query_posts()
       #10 /home2/sukkianet/public_html/wp-includes/functions.php(1336): WP->main()
       #11 /home2/sukkianet/public_html/wp-blog-header.php(16): wp()
       #12 /home2/sukkianet/public_html/index.php(17): require('/home2/sukkiane...')
       #13 {main}
         thrown tässä /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php rivillä 1134
   
       2023-11-08T08:57:28+00:00 CRITICAL Uncaught Error: Attempt to assign property "object_id" on bool in /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php:1134
       Stack trace:
       #0 /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php(828): WP_Term_Query->populate_terms()
       #1 /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php(311): WP_Term_Query->get_terms()
       #2 /home2/sukkianet/public_html/wp-includes/taxonomy.php(1332): WP_Term_Query->query()
       #3 /home2/sukkianet/public_html/wp-includes/taxonomy.php(2291): get_terms()
       #4 /home2/sukkianet/public_html/wp-includes/taxonomy.php(3804): wp_get_object_terms()
       #5 /home2/sukkianet/public_html/wp-includes/post.php(7804): update_object_term_cache()
       #6 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3334): _prime_post_caches()
       #7 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3824): WP_Query->get_posts()
       #8 /home2/sukkianet/public_html/wp-includes/class-wp-query.php(3956): WP_Query->query()
       #9 /home2/sukkianet/public_html/wp-content/themes/basel/inc/shortcodes/shortcodes.php(3637): WP_Query->__construct()
       #10 /home2/sukkianet/public_html/wp-includes/shortcodes.php(433): basel_shortcode_products()
       #11 [internal function]: do_shortcode_tag()
       #12 /home2/sukkianet/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
       #13 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/helpers/helpers.php(265): do_shortcode()
       #14 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/templates/shortcodes/vc_column.php(94): wpb_js_remove_wpautop()
       #15 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/core/class-wpbakeryshortcode.php(457): require('/home2/sukkiane...')
       #16 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/core/class-wpbakeryshortcode.php(430): WPBakeryShortCode->loadTemplate()
       #17 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/core/class-wpbakeryshortcode.php(552): WPBakeryShortCode->content()
       #18 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/helpers/helpers.php(1318): WPBakeryShortCode->output()
       #19 /home2/sukkianet/public_html/wp-includes/shortcodes.php(433): vc_do_shortcode()
       #20 [internal function]: do_shortcode_tag()
       #21 /home2/sukkianet/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
       #22 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/helpers/helpers.php(265): do_shortcode()
       #23 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/templates/shortcodes/vc_row.php(156): wpb_js_remove_wpautop()
       #24 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/core/class-wpbakeryshortcode.php(457): require('/home2/sukkiane...')
       #25 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/vc-row.php(40): WPBakeryShortCode->loadTemplate()
       #26 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/classes/shortcodes/core/class-wpbakeryshortcode.php(552): WPBakeryShortCode_Vc_Row->content()
       #27 /home2/sukkianet/public_html/wp-content/plugins/js_composer/include/helpers/helpers.php(1318): WPBakeryShortCode->output()
       #28 /home2/sukkianet/public_html/wp-includes/shortcodes.php(433): vc_do_shortcode()
       #29 [internal function]: do_shortcode_tag()
       #30 /home2/sukkianet/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
       #31 /home2/sukkianet/public_html/wp-includes/class-wp-hook.php(324): do_shortcode()
       #32 /home2/sukkianet/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters()
       #33 /home2/sukkianet/public_html/wp-includes/post-template.php(256): apply_filters()
       #34 /home2/sukkianet/public_html/wp-content/themes/basel/page.php(28): the_content()
       #35 /home2/sukkianet/public_html/wp-includes/template-loader.php(106): include('/home2/sukkiane...')
       #36 /home2/sukkianet/public_html/wp-blog-header.php(19): require_once('/home2/sukkiane...')
       #37 /home2/sukkianet/public_html/index.php(17): require('/home2/sukkiane...')
       #38 {main}
         thrown tässä /home2/sukkianet/public_html/wp-includes/class-wp-term-query.php rivillä 1134
       ```
   
 *  [Faar](https://wordpress.org/support/users/faar/)
 * (@faar)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/fatal-errors-object_id-2/#post-17184588)
 * This error message
 *     ```wp-block-code
       Attempt to assign property "object_id" on bool
       ```
   
 * is because it looks like NULL->object_id and this will not work.
   The reason may
   be the same like in my case, $term isn’t an object but a boolean called NULL.
   Why?In special cases get_term() can return NULL instead an object.Try this i 
   wrote in the last post down there:[https://wordpress.org/support/topic/fatal-error-attempt-to-assign-property-object_id-on-bool/#post-17184357](https://wordpress.org/support/topic/fatal-error-attempt-to-assign-property-object_id-on-bool/#post-17184357)
   But somewhere there must be an incorrect database table of taxonomies or like
   this. This should be solved too.Did you use the WPML Plugin?
 *  Thread Starter [tuomonurkkala](https://wordpress.org/support/users/tuomonurkkala/)
 * (@tuomonurkkala)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/fatal-errors-object_id-2/#post-17184843)
 * Hi [@faar](https://wordpress.org/support/users/faar/)
 * So you added this code to class-wp-term-query.php:
 *     ```wp-block-code
                   $term = get_term( $term_data->term_id );
                   if ( is_object($term) && property_exists( $term_data, 'object_id' ) ) {
                       $term->object_id = (int) $term_data->object_id;
                   }
       ```
   
 * in my case to 1118 row?
 * And yes I have WPML Plugin and many others as well.
 * Best Regards,
 * Tuomo Nurkkala
 *  [Faar](https://wordpress.org/support/users/faar/)
 * (@faar)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/fatal-errors-object_id-2/#post-17184961)
 * I changed this code with inserting/adding
 *     ```wp-block-code
       is_object($term) &&
       ```
   
 * in line 1117, where is asked if property exists.
   The IF-code only asks if a property
   exists, not if $term is an object. So adding my snippet to this IF statement 
   will also ask if §term is an object. If you updated your WP it will be now on
   line 1133: [https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-term-query.php#L1133](https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-term-query.php#L1133)
   The fatal PHP error then occurs in line 1134.
 * Keep in mind, allways have a copy of the original code. 😉
 *  Thread Starter [tuomonurkkala](https://wordpress.org/support/users/tuomonurkkala/)
 * (@tuomonurkkala)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/fatal-errors-object_id-2/#post-17185790)
 * Hi [@faar](https://wordpress.org/support/users/faar/)
 * Thanks for the help! 🙂
 * Yes I actually updated the WP just little while ago.
 *  Thread Starter [tuomonurkkala](https://wordpress.org/support/users/tuomonurkkala/)
 * (@tuomonurkkala)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/fatal-errors-object_id-2/#post-17209639)
 * Hi [@faar](https://wordpress.org/support/users/faar/)
 * I got information that the problem might be on the table collations in different
   sites. You can look at these in your phpMyAdmin. Some sites might have more utf8mb4_unicode_ci
   table collations and some might have more of these utf8mb4_unicode_520_ci.
 * Here is one way to fix this problem:
 * [https://kau-boys.com/2976/database/fixing-the-illegal-mix-of-collations-wordpress-database-error](https://kau-boys.com/2976/database/fixing-the-illegal-mix-of-collations-wordpress-database-error)
 *     ```wp-block-code
       SELECT CONCAT("ALTER TABLE ",TABLE_SCHEMA,".",TABLE_NAME," CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;")
       FROM information_schema.TABLES
       WHERE TABLE_SCHEMA="wp_project_name";
       ```
   

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

The topic ‘Fatal errors object_id’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [tuomonurkkala](https://wordpress.org/support/users/tuomonurkkala/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/fatal-errors-object_id-2/#post-17209639)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
