Tagged: ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1421518

    One of our sites is continually getting the below error. Any ideas what’s going on with the term_id? Could it have something to do with Woo Commerce also being installed?

    Error message:
    Attempt to read property “term_id” on int

    Error:
    in require called at /nas/content/live/mywtenfold/wp-includes/template.php (787)
    in load_template called at /nas/content/live/mywtenfold/wp-includes/template.php (720)
    in locate_template called at /nas/content/live/mywtenfold/wp-includes/general-template.php (206)
    in get_template_part called at /nas/content/live/mywtenfold/wp-content/themes/enfold/single.php (51)
    in include called at /nas/content/live/mywtenfold/wp-includes/template-loader.php (106)
    in require_once called at /nas/content/live/mywtenfold/wp-blog-header.php (19)
    in require called at /nas/content/live/mywtenfold/index.php (17)

    #1421564

    Hi mgyura,

    I tried to check on your website however I don’t see the issue showing, is it only showing on the backend?

    Best regards,
    Nikko

    #1421630

    Correct, we use New Relic and this is where we’re getting the errors from.

    Here’s a quick video of the errors we’re seeing:

    #1421848

    Hi mgyura,

    It seems the error is somehow related to Woocommerce as you mentioned before:
    https://stackoverflow.com/questions/73290406/warning-attempt-to-read-property-term-id-on-int-woocommerce

    Can you give us a copy /nas/content/live/mywtenfold/index.php ?
    or if you can setup a staging site for us, that would help us try to debug the issue.

    Best regards,
    Nikko

    #1422036

    The site is a subsite on a multisite. I could migrate it to a dev standalone, but that would take some work. Let me know if that step is needed and I will get it done.

    Here’s the contents of the /nas/content/live/mywtenfold/index.php:

    <?php
    /**
    * Front to the WordPress application. This file doesn’t do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define( ‘WP_USE_THEMES’, true );

    /** Loads the WordPress Environment and Template */
    require __DIR__ . ‘/wp-blog-header.php’;

    #1422176

    Hi mgyura,

    Thanks, that’s I think the normal content of index.php of WordPress, I don’t see anything wrong with it.
    Can setup a staging site for us? and give us admin and FTP access for it, so it would help us try to debug the issue.

    Best regards,
    Nikko

    #1422252

    Thank you for your help. I’ve setup a dev site here with a copy. This is on its own install so feel free to break the internet with it. Just let me know what you find and when I can take it down.

    #1422849

    Hi mgyura,

    Thanks for setting up a staging site.
    The problem is coming from related-posts.php of your child theme (under includes folder).
    I have modified it and it seems to fix the issue, can you try to backup related-posts.php of your child theme on the live site and replace it with the one in the staging site, let us know if it helps.

    Best regards,
    Nikko

    #1423477

    Thank you very much! Great catch.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Attempt to read property “term_id” on int’ is closed to new replies.