• Hi,
    We are having issues with Version 6.1.1. Cannot create a new post or upload a new media. I get the following warnings / notices. As a result I get ID=0 row in the wp-posts table.

    Would really appreciate help with resolving this.

    Thanks,
    Ruben

    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-includes/post.php on line 7622
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-includes/post.php on line 7623
    PHP Notice:  Trying to get property 'ID' of non-object in /home/wplive/web/wp-live/wp-includes/post.php on line 7627
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-includes/post.php on line 7872
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-includes/theme.php on line 3532
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-content/mu-plugins/10web-manager/includes/class-cache.php on line 75
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-includes/theme.php on line 3757
    PHP Warning:  First parameter must either be an object or the name of an existing class in /home/wplive/web/wp-live/wp-content/plugins/sucuri-scanner/src/hook.lib.php on line 675
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-includes/post.php on line 5405
    PHP Notice:  Trying to get property 'ID' of non-object in /home/wplive/web/wp-live/wp-includes/post.php on line 5405
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-includes/post.php on line 4706
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-post.php on line 266
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-content/plugins/advanced-custom-fields-pro/includes/forms/form-post.php on line 277
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-content/plugins/advanced-custom-fields-pro/includes/admin/admin-field-group.php on line 383
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-content/plugins/memberpress/app/lib/MeprCptCtrl.php on line 37
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-content/plugins/wpforms/src/Forms/Locator.php on line 660
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-content/plugins/give/includes/payments/class-give-sequential-donation-number.php on line 81
    PHP Notice:  Trying to get property 'post_type' of non-object in /home/wplive/web/wp-live/wp-admin/includes/post.php on line 709
    PHP Warning:  Creating default object from empty value in /home/wplive/web/wp-live/wp-admin/includes/post.php on line 748
    PHP Notice:  Undefined property: stdClass::$ID in /home/wplive/web/wp-live/wp-admin/post-new.php on line 67
    PHP Notice:  Undefined property: stdClass::$post_status in /home/wplive/web/wp-live/wp-admin/edit-form-blocks.php on line 91
    PHP Notice:  Undefined property: stdClass::$post_type in /home/wplive/web/wp-live/wp-admin/includes/meta-boxes.php on line 1447
    PHP Notice:  Undefined property: stdClass::$post_type in /home/wplive/web/wp-live/wp-includes/taxonomy.php on line 276
    PHP Notice:  Undefined property: stdClass::$post_type in /home/wplive/web/wp-live/wp-includes/taxonomy.php on line 279
    PHP Notice:  Undefined property: stdClass::$post_type in /home/wplive/web/wp-live/wp-content/plugins/visual-portfolio/classes/class-custom-post-type.php on line 660
    PHP Notice:  Undefined property: stdClass::$post_type in /home/wplive/web/wp-live/wp-admin/edit-form-blocks.php on line 298
    PHP Notice:  Undefined property: stdClass::$post_status in /home/wplive/web/wp-live/wp-admin/includes/post.php on line 2395
    PHP Notice:  Undefined property: stdClass::$post_type in /home/wplive/web/wp-live/wp-admin/includes/post.php on line 2433
    PHP Notice:  Undefined property: stdClass::$post_status in /home/wplive/web/wp-live/wp-admin/includes/post.php on line 2434

    Added log to print the stack trace:

    (
        [0] => Array
            (
                [file] => /home/wplive/web/wp-live/wp-includes/class-wp-hook.php
                [line] => 308
                [function] => _transition_post_status
                [args] => Array
                    (
                        [0] => auto-draft
                        [1] => new
                        [2] => 
                    )
    
            )
    
        [1] => Array
            (
                [file] => /home/wplive/web/wp-live/wp-includes/class-wp-hook.php
                [line] => 332
                [function] => apply_filters
                [class] => WP_Hook
                [object] => WP_Hook Object
                    (
                        [callbacks] => Array
                            (
                                [5] => Array
                                    (
                                        [_transition_post_status] => Array
                                            (
                                                [function] => _transition_post_status
                                                [accepted_args] => 3
                                            )
    
                                    )
    
                                [10] => Array
                                    (
                                        [_update_term_count_on_transition_post_status] => Array
                                            (
                                                [function] => _update_term_count_on_transition_post_status
                                                [accepted_args] => 3
                                            )
    
                                        [_wp_auto_add_pages_to_menu] => Array
                                            (
                                                [function] => _wp_auto_add_pages_to_menu
                                                [accepted_args] => 3
                                            )
    
                                        [_wp_customize_publish_changeset] => Array
                                            (
                                                [function] => _wp_customize_publish_changeset
                                                [accepted_args] => 3
                                            )
    
                                        [__clear_multi_author_cache] => Array
                                            (
                                                [function] => __clear_multi_author_cache
                                                [accepted_args] => 1
                                            )
    
                                        [block_core_calendar_update_has_published_post_on_transition_post_status] => Array
                                            (
                                                [function] => block_core_calendar_update_has_published_post_on_transition_post_status
                                                [accepted_args] => 3
                                            )
    
                                        [0000000041bbf9ab000000005bad9d61on_transition_post_purge] => Array
                                            (
                                                [function] => Array
                                                    (
                                                        [0] => Tenweb_Manager\TenwebCache Object
                                                            (
                                                                [login_instance:Tenweb_Manager\TenwebCache:private] => Tenweb_Authorization\Login Object
                                                                    (
                                                                        [domain_id:Tenweb_Authorization\Login:private] => 
                                                                        [access_token:Tenweb_Authorization\Login:private] => xxx
                                                                        [refresh_token:Tenweb_Authorization\Login:private] => xxx
                                                                        [connected_from:Tenweb_Authorization\Login:private] => manager
                                                                        [error_logs:Tenweb_Authorization\Login:private] => Array
                                                                            (
                                                                            )
    
                                                                    )
    
                                                            )
    
                                                        [1] => on_transition_post_purge
                                                    )
    
                                                [accepted_args] => 3
                                            )
    
                                    )
    
                                [20] => Array
                                    (
                                        [_wp_keep_alive_customize_changeset_dependent_auto_drafts] => Array
                                            (
                                                [function] => _wp_keep_alive_customize_changeset_dependent_auto_drafts
                                                [accepted_args] => 3
                                            )
    
                                    )
    
                                [50] => Array
                                    (
                                        [SucuriScanHook::hookPostStatus] => Array
                                            (
                                                [function] => SucuriScanHook::hookPostStatus
                                                [accepted_args] => 3
                                            )
    
                                    )
    
                            )
    
                        [iterations:WP_Hook:private] => Array
                            (
                                [0] => Array
                                    (
                                        [0] => 5
                                        [1] => 10
                                        [2] => 20
                                        [3] => 50
                                    )
    
                            )
    
                        [current_priority:WP_Hook:private] => Array
                            (
                                [0] => 5
                            )
    
                        [nesting_level:WP_Hook:private] => 1
                        [doing_action:WP_Hook:private] => 1
                    )
    
                [type] => ->
                [args] => Array
                    (
                        [0] => 
                        [1] => Array
                            (
                                [0] => auto-draft
                                [1] => new
                                [2] => 
                            )
    
                    )
    
            )
    
        [2] => Array
            (
                [file] => /home/wplive/web/wp-live/wp-includes/plugin.php
                [line] => 517
                [function] => do_action
                [class] => WP_Hook
                [object] => WP_Hook Object
                    (
                        [callbacks] => Array
                            (
                                [5] => Array
                                    (
                                        [_transition_post_status] => Array
                                            (
                                                [function] => _transition_post_status
                                                [accepted_args] => 3
                                            )
    
                                    )
    
                                [10] => Array
                                    (
                                        [_update_term_count_on_transition_post_status] => Array
                                            (
                                                [function] => _update_term_count_on_transition_post_status
                                                [accepted_args] => 3
                                            )
    
                                        [_wp_auto_add_pages_to_menu] => Array
                                            (
                                                [function] => _wp_auto_add_pages_to_menu
                                                [accepted_args] => 3
                                            )
    
                                        [_wp_customize_publish_changeset] => Array
                                            (
                                                [function] => _wp_customize_publish_changeset
                                                [accepted_args] => 3
                                            )
    
                                        [__clear_multi_author_cache] => Array
                                            (
                                                [function] => __clear_multi_author_cache
                                                [accepted_args] => 1
                                            )
    
                                        [block_core_calendar_update_has_published_post_on_transition_post_status] => Array
                                            (
                                                [function] => block_core_calendar_update_has_published_post_on_transition_post_status
                                                [accepted_args] => 3
                                            )
    
                                        [0000000041bbf9ab000000005bad9d61on_transition_post_purge] => Array
                                            (
                                                [function] => Array
                                                    (
                                                        [0] => Tenweb_Manager\TenwebCache Object
                                                            (
                                                                [login_instance:Tenweb_Manager\TenwebCache:private] => Tenweb_Authorization\Login Object
                                                                    (
                                                                        [domain_id:Tenweb_Authorization\Login:private] => 
                                                                        [access_token:Tenweb_Authorization\Login:private] => xxx
                                                                        [refresh_token:Tenweb_Authorization\Login:private] => xxx
                                                                        [connected_from:Tenweb_Authorization\Login:private] => manager
                                                                        [error_logs:Tenweb_Authorization\Login:private] => Array
                                                                            (
                                                                            )
    
                                                                    )
    
                                                            )
    
                                                        [1] => on_transition_post_purge
                                                    )
    
                                                [accepted_args] => 3
                                            )
    
                                    )
    
                                [20] => Array
                                    (
                                        [_wp_keep_alive_customize_changeset_dependent_auto_drafts] => Array
                                            (
                                                [function] => _wp_keep_alive_customize_changeset_dependent_auto_drafts
                                                [accepted_args] => 3
                                            )
    
                                    )
    
                                [50] => Array
                                    (
                                        [SucuriScanHook::hookPostStatus] => Array
                                            (
                                                [function] => SucuriScanHook::hookPostStatus
                                                [accepted_args] => 3
                                            )
    
                                    )
    
                            )
    
                        [iterations:WP_Hook:private] => Array
                            (
                                [0] => Array
                                    (
                                        [0] => 5
                                        [1] => 10
                                        [2] => 20
                                        [3] => 50
                                    )
    
                            )
    
                        [current_priority:WP_Hook:private] => Array
                            (
                                [0] => 5
                            )
    
                        [nesting_level:WP_Hook:private] => 1
                        [doing_action:WP_Hook:private] => 1
                    )
    
                [type] => ->
                [args] => Array
                    (
                        [0] => Array
                            (
                                [0] => auto-draft
                                [1] => new
                                [2] => 
                            )
    
                    )
    
            )
    
        [3] => Array
            (
                [file] => /home/wplive/web/wp-live/wp-includes/post.php
                [line] => 5347
                [function] => do_action
                [args] => Array
                    (
                        [0] => transition_post_status
                        [1] => auto-draft
                        [2] => new
                        [3] => 
                    )
    
            )
    
        [4] => Array
            (
                [file] => /home/wplive/web/wp-live/wp-includes/post.php
                [line] => 4607
                [function] => wp_transition_post_status
                [args] => Array
                    (
                        [0] => auto-draft
                        [1] => new
                        [2] => 
                    )
    
            )
    
        [5] => Array
            (
                [file] => /home/wplive/web/wp-live/wp-admin/includes/post.php
                [line] => 706
                [function] => wp_insert_post
                [args] => Array
                    (
                        [0] => Array
                            (
                                [post_author] => 89
                                [post_content] => 
                                [post_content_filtered] => 
                                [post_title] => Auto Draft
                                [post_excerpt] => 
                                [post_status] => auto-draft
                                [post_type] => post
                                [comment_status] => 
                                [ping_status] => 
                                [post_password] => 
                                [to_ping] => 
                                [pinged] => 
                                [post_parent] => 0
                                [menu_order] => 0
                                [guid] => 
                                [import_id] => 0
                                [context] => 
                                [post_date] => 
                                [post_date_gmt] => 
                                [ID] => 0
                                [filter] => db
                            )
    
                        [1] => 
                        [2] => 
                    )
    
            )
    
        [6] => Array
            (
                [file] => /home/wplive/web/wp-live/wp-admin/post-new.php
                [line] => 66
                [function] => get_default_post_to_edit
                [args] => Array
                    (
                        [0] => post
                        [1] => 1
                    )
    
            )
    
    )
    • This topic was modified 1 year, 11 months ago by rubenhak.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi, maybe your core files are broken,
    Try downloading WordPress again, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel, and delete then replace your copies of everything except the wp-config.php file and the /wp-content/ directory with fresh copies from the download. This will effectively replace all of your core files without damaging your content and settings.

    Some uploaders tend to be unreliable when overwriting files, so don’t forget to delete the original files before replacing them.

    Thread Starter rubenhak

    (@rubenhak)

    hi Benni, I just tried. No difference ??

    Were you doing anything with your database. I’m wondering if maybe your database schema has been corrupted. All the problems being listed would be items that live in the post and post_meta tables. I had something like this once when I restored a database and the schema didn’t restore correctly. I had another backup and restored from it and it corrected the problem.

    Thread Starter rubenhak

    (@rubenhak)

    hi @mrtom414, Yes, I reimported the database.
    What is the best way to compare the wordpress database schema?

    I tried to fix this problem when I had it. But was unable to recreate the and join the keys in the table. If the Schema is missed up none of the tables will have key set for them and will not be joined to the corresponding tables. You might be able to do a reinstall and import the data into each table after it generates the new schema. You would probably have to make sure none of the keys are going to be duplicated with the new schema that just been created. I’m not sure if it will work but it worth a try.

    I think once the tables and schema has been created you could probably empty the tables and just import the data. Just dont recreate the tables. You might have to edit your sql files so they are not recreating tables only import the data.

    Thread Starter rubenhak

    (@rubenhak)

    Turns out it was my fault. I had to split the DB script into smaller scripts per table and only imported the key tables without wp_users and wp_usermeta. I then missed the fact that the larger script contains lots of “ALTER TABLE” statements that I had missed to import.

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