• Resolved insp4fr

    (@insp4fr)


    Hello,

    Mostly for information, and potential improvement.

    We are using a few ultimate shortcodes on our future site and got to spend some time on a bug before discovering the “bug” doesn’t appear when debug mode is off.

    Description of the bug
    – context : Debug mode ON , ie in wp-config.php we have :
    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_DISPLAY’, true);
    define(‘WP_DEBUG_LOG’, true);

    – test page content for Shortcode Ultimate :

    <strong>single-post</strong>
    [su_posts template="templates/single-post.php" posts_per_page="10" post_type="post" taxonomy="test-equipes" tax_term="84" tax_operator="IN" offset="0" order="desc" orderby="date" post_status="publish" ignore_sticky_posts="no"]
    
    <strong>list-loop</strong>
    [su_posts template="templates/list-loop.php" posts_per_page="10" post_type="post" taxonomy="test-equipes" tax_term="84" tax_operator="IN" offset="0" order="desc" orderby="date" post_status="publish" ignore_sticky_posts="no"]
    
    <strong>default-loop</strong>
    [su_posts taxonomy="test-equipes" tax_term="84" order="desc"]
    
    <strong>teaser-loop</strong>
    [su_posts template="templates/teaser-loop.php" posts_per_page="10" post_type="post" taxonomy="test-equipes" tax_term="84" tax_operator="IN" offset="0" order="desc" orderby="date" post_status="publish" ignore_sticky_posts="no"]

    – Display of the page
    => the problem appear for the loops “default-loop” and “teaser-loop”
    => in all our tests the icon of the first post displayed never appear, but all the others does
    => the error messages displayed on the page say “Notice: Trying to get property of non-object in …/wp-includes/post-thumbnails: template.php on line 106”

    – Display of the page after activating the “Query Monitor” plugin :
    => the page appear OK : we have all the post icons and no error message, but…
    => in the “PHP Errors” list of the “Query Monitor” screen we have :
    Level Message Place
    Notification Trying to get property of non-object wp-includes/post-thumbnail-template.php:106
    Notification Undefined property: WP_Tax_Query::$ID wp-includes/post-thumbnail-template.php:106
    Notification Undefined property: WP_Meta_Query::$ID wp-includes/post-thumbnail-template.php:106

    The number of first notification match the number of posts to be displayed.

    – Display of the page, with Debug mode OFF :
    => everything “seems” OK

    Sincerely,
    insp4fr

  • The topic ‘Thumbnail bug with shortcode post’ is closed to new replies.