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

  • 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 3 replies - 1 through 3 (of 3 total)
  • 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 9 months, 1 week 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.

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