Support » Plugin: Posts in Sidebar » Trying to get property of non-object notices

  • Resolved psuba

    (@psuba)


    I am getting a couple of Trying to get property of non-object notices on every page I use a widget with the plugin. I was able to trace it back to this plugin as it is show from the call stack below (note – it is always these two notices, probably logical that the same notice is thrown on two consecutive lines):

    Trying to get property of non-object
    wp-includes/post.php:6073

    wp_queue_posts_for_term_meta_lazyload()
    wp-includes/class-wp-query.php:3017
    WP_Query->get_posts()
    wp-includes/class-wp-query.php:3238
    WP_Query->query()
    wp-includes/class-wp-query.php:3347
    WP_Query->__construct()
    wp-content/plugins/posts-in-sidebar/inc/pis-main.php:527
    pis_get_posts_in_sidebar()
    wp-content/plugins/posts-in-sidebar/inc/pis-main.php:873
    pis_posts_in_sidebar()
    wp-content/plugins/posts-in-sidebar/inc/pis-widget.php:474
    PIS_Posts_In_Sidebar->widget()
    wp-includes/class-wp-widget.php:395
    WP_Widget->display_callback()
    wp-includes/widgets.php:738
    dynamic_sidebar(‘sidebar’)
    wp-content/themes/themedir/sidebar.php:3

    Trying to get property of non-object
    wp-includes/post.php:6074

    wp_queue_posts_for_term_meta_lazyload()
    wp-includes/class-wp-query.php:3017
    WP_Query->get_posts()
    wp-includes/class-wp-query.php:3238
    WP_Query->query()
    wp-includes/class-wp-query.php:3347
    WP_Query->__construct()
    wp-content/plugins/posts-in-sidebar/inc/pis-main.php:527
    pis_get_posts_in_sidebar()
    wp-content/plugins/posts-in-sidebar/inc/pis-main.php:873
    pis_posts_in_sidebar()
    wp-content/plugins/posts-in-sidebar/inc/pis-widget.php:474
    PIS_Posts_In_Sidebar->widget()
    wp-includes/class-wp-widget.php:395
    WP_Widget->display_callback()
    wp-includes/widgets.php:738
    dynamic_sidebar(‘sidebar’)
    wp-content/themes/themedir/sidebar.php:3

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Aldo

    (@aldolat)

    Hello,
    thank you so much for reporting this.

    I do not receive any notice in my test environment, so I could only try to guess the reason. Perhaps the combination of your theme/plugins with Posts in Sidebar is causing this? Have you tried another theme? Have you tried deactivating all plugins except Posts in Sidebar? When this type of situation occurs, the only way is to try this path.

    Also, could you tell me where you receive this notices? Do you receive them in wp-content/debug.log file?

    Hi,

    Indeed this is in the debug.log when the debug option is switched on (it is a warning).
    On reflection, I think you may be right and this may be coming from the CPT-onomies plugin probably, as I know there are other issues with caching terms that this plugin utilises after the 4.7 release. I suspect this warning is a side-effect of your plugin pulling the post info even if it is not displaying anything that I am using CPT-onomies for.

    I wonder if it is possible to limit the impact of other plugins with Post in Sidebar when only displaying certain information, but I am not claiming to be an expert in WordPress architecture and have a suspicion that it would not be possible given how WordPress objects and hooks are constructed.

    Plugin Author Aldo

    (@aldolat)

    Hi,
    I will make a test with CPT-onomies plugin and I’ll let you know here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Trying to get property of non-object notices’ is closed to new replies.