WordPress.org

Ready to get started?Download WordPress

Forums

All in One SEO Pack
[resolved] Undefined property: WP_Query::$post (8 posts)

  1. styledev
    Member
    Posted 11 months ago #

    On any "Add" page in the All in One SEO Pack box I am seeing three notices when WP_DEBUG mode is turned on:

    Notice: Undefined property: WP_Query::$post in /Users/dbushaw/Sites/technobuffalo/wp-includes/query.php on line 3017

    Notice: Undefined property: WP_Query::$post in /Users/dbushaw/Sites/technobuffalo/wp-includes/query.php on line 3017

    Notice: Trying to get property of non-object in /Users/dbushaw/Sites/technobuffalo/wp-includes/query.php on line 3496

    Can you look into fixing this?

    http://wordpress.org/extend/plugins/all-in-one-seo-pack/

  2. Peter Baylies
    Member
    Plugin Author

    Posted 11 months ago #

    styledev,

    Sure; do you have any other plugins that show up on that screen as well? I haven't seen this error before, so it'd be nice to know if this is a conflict with another plugin or with your theme.

  3. styledev
    Member
    Posted 11 months ago #

    I thought that might be the case to so I disabled all other plugins and activated the Twenty Twelve theme and still saw the same notices.

  4. Peter Baylies
    Member
    Plugin Author

    Posted 11 months ago #

    styledev,

    Thanks for that; try commenting out or removing line 455 of aioseop_class.php - it should look like this in the plugin:

    $wp_query = new WP_Query( array( 'p' => $post_id, 'post_type' => $post->post_type ) );

    Let me know if that fixes your issue and if the snippet displays properly and things work otherwise. It looks like WordPress goes to some lengths here to set up a new empty post before it's created, and the plugin was unkindly querying for it before it exists there; hence, get_queried_object() complains about it.

  5. styledev
    Member
    Posted 11 months ago #

    That works, I put a conditional on line 455 instead of commenting it out permanently. Can you test this and if you are cool with it put it into the next version? I would greatly appreciate it.

    if (! $post->post_modified_gmt != '' )

  6. Peter Baylies
    Member
    Plugin Author

    Posted 11 months ago #

    Interesting double negation there; would is_empty() work here? I'll test, thank you.

  7. Peter Baylies
    Member
    Plugin Author

    Posted 11 months ago #

    styledev,

    Ok; update pushed, and your fix is in; thank you!

  8. styledev
    Member
    Posted 11 months ago #

    Works perfect, thank you for working on this with me.

Reply

You must log in to post.

About this Plugin

About this Topic