Support » Plugin: Duplicate Post » Trying to get property of non-object

  • Resolved Kevin Pfeifer

    (@beardcat)


    Dear Support-Team!

    I recently checked my website’s debug.log and have seen following entries:

    PHP Notice: Trying to get property of non-object in <my-docroot>/wp-content/plugins/duplicate-post/duplicate-post-common.php on line 149

    PHP Notice: Trying to get property of non-object in <my-docroot>/wp-content/plugins/duplicate-post/duplicate-post-common.php on line 123

    Both if queries expect, that the $post variable has a property “post_type”.

    But what if it hasn’t => if the post-id given in $_GET is no valid?

    Please add a check to these 2 if queries so there is no debug.log output.

    The page I need help with: [log in to see the link]

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

    (@thehowarde)

    I also get this error. I am using PHP 7.2 and I believe your error is the function

    duplicate_post_is_post_type_enabled()

    The error only occurs on post types where duplicate post is NOT enabled.

    • This reply was modified 12 months ago by  thehowarde.

    I also get this error generated from plugin file /duplicate-post/duplicate-post-common.php

    These notices can be resolved by changing the following condition in the above plugin file

    Before :
    if ( is_admin() && isset( $_GET['post'] ))

    After :
    if ( is_admin() && isset( $_GET['post'] ) && ! empty( $_GET['post'] ))

    I get the same issue when using Contact Form 7. I get the warning when entering the CF7 menus. Please add this check to resolve the issue in the next version of the plugin.

    Still this error.
    I have used the solution present in this support ticket: https://wordpress.org/support/topic/some-bug-exits-on-latest-version/

    It works!

    But it would be nice that the next update would bring this error to an end, since so many people have reported it and found how to correct this. Maybe the author could implement one of the solutions already found with next next update 🙂

    Cheers

    Hello!
    Same error here, it appears in Contact Form 7 backend page.

    Plugin Author Lopo

    (@lopo)

    Hi @tamara-it @magaworks @jordanwebdev @vinod-dalvi @thehowarde,
    version 3.2.3 fixes the issue. Sorry for the delay…

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.