Home › Toolset Professional Support › [Resolved] Fatal error when I create a new page, or a new article or a new item of a cpt
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
This topic contains 11 replies, has 3 voices.
Last updated by Christopher Amirian 12 months ago.
Assisted by: Christopher Amirian.
Trying to create a new page, a new article or a new item of any custom post type (created with toolset type) gives me a critical error. I tried updating your plugins, deactivating all unnecessary plugins, switching themes, updating the wordpress version, changing the php version but nothing has changed. The errors it returns are the following:
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-includes/post.php on line 7589
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-includes/post.php on line 7590
Warning: Attempt to read property "ID" on null in ---/httpdocs/wp-includes/post.php on line 7594
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-includes/post.php on line 7837
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-includes/theme.php on line 3502
Warning: Attempt to read property "ID" on null in ---/httpdocs/wp-content/plugins/bb-ultimate-addon/classes/class-uabb-backward.php on line 60
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-content/plugins/toolset-blocks/backend/Controllers/Admin/ContentTemplate.php on line 78
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-includes/theme.php on line 3727
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-includes/post.php on line 5375
Warning: Attempt to read property "ID" on null in ---/httpdocs/wp-includes/post.php on line 5375
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-includes/post.php on line 4676
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-content/plugins/bb-plugin/classes/class-fl-builder-model.php on line 6044
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-content/plugins/toolset-blocks/vendor/toolset/toolset-common/user-editors/editor/screen/gutenberg/backend.php on line 639
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php on line 709
Warning: Attempt to read property "post_status" on null in ---/httpdocs/wp-content/plugins/toolset-blocks/backend/Services/ViewParsingService.php on line 158
Warning: Attempt to read property "post_type" on null in ---/httpdocs/wp-content/plugins/toolset-blocks/backend/Services/ViewParsingService.php on line 161
Warning: Attempt to read property "post_content" on null in ---/httpdocs/wp-content/plugins/toolset-blocks/backend/Services/ViewParsingService.php on line 166
Warning: Attempt to read property "post_content" on null in ---/httpdocs/wp-content/plugins/toolset-blocks/backend/Services/ViewParsingService.php on line 107
Fatal error: Uncaught TypeError: OTGS\Toolset\Views\Controllers\Admin\ContentTemplate::set_default_content_template_meta(): Argument #2 ($post) must be of type WP_Post, null given, called in ---/httpdocs/wp-includes/class-wp-hook.php on line 307 and defined in ---/httpdocs/wp-content/plugins/toolset-blocks/backend/Controllers/Admin/ContentTemplate.php:138 Stack trace: #0 ---/httpdocs/wp-includes/class-wp-hook.php(307): OTGS\Toolset\Views\Controllers\Admin\ContentTemplate->set_default_content_template_meta() #1 ---/httpdocs/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #2 ---/httpdocs/wp-includes/plugin.php(474): WP_Hook->do_action() #3 ---/httpdocs/wp-includes/post.php(4698): do_action() #4 ---/httpdocs/wp-admin/includes/post.php(700): wp_insert_post() #5 ---/httpdocs/wp-admin/post-new.php(66): get_default_post_to_edit() #6 {main} thrown in ---/httpdocs/wp-content/plugins/toolset-blocks/backend/Controllers/Admin/ContentTemplate.php on line 138
Version WordPress: 5.9.9
Version php: 8.0.3
Theme active: Astra-child
Theme: Astra version 4.1.5
Version Toolset Types: 3.4.19
Version Toolset Blocks: 1.6.7
Can you help me solve it? Thanks!
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+01:00)
Hi there
You say that you've tried updating WordPress and updating plugins and it hasn't helped.
From the debug info you shared, you are using an old version of WordPress (5.9.9), and a fairly old version of Blocks (1.6.7 vs the current 1.6.14).
Can you clarify, did you update to the current (or near-current) version of WordPress (6.5, or 6.4.3), and the latest versions of Blocks (1.6.14) and Types (3.5.2)?
Hi Nigel, thanks for the reply.
Trying to resolve the fatal error, I updated the plugins and WordPress to the latest version, but it didn't work so I restored the backup before the updates. In particular I tried to update to WordPress 6.5, Blocks 1.6.14 and Types 3.5.2 but, as mentioned above, it didn't work.
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+01:00)
If you already did that, and you also switched theme, I think we will need a copy of your site to be able to try to debug the problem locally, it isn't something we've had any other reports of.
Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site. We'll add a plugin to take a site copy.
Hi Nigel!
You didn't let me know anything more. Made the copy? The site owner requests a response.
Thank you
Hi there,
A copy of the website is created and the issue will be reported to the second-tier support for further investigation.
This might take etie as the second-tier will be available during the week days and not weekend.
Thank you.
Hi there,
A copy of the website is created and the issue will be reported to the second-tier support for further investigation.
This might take etie as the second-tier will be available during the week days and not weekend.
Thank you.
The error report is submitted.
I will get back to you as soon as I have an answer from the second tier support.
Thanks.
Thanks Christopher for the clarification!
Hi there,
I have an answer from the second tier support:
When trying to create a new page, for example, there are a whole bunch of PHP warnings before the error—from Blocks—eventually occurs.
The error just happens to be reported by Toolset, but the problem occurs much earlier, as indicated by all of the warnings.
If you disable all plugins (including Toolset) and switch to a default theme you just get an error in a different place:
PHP Fatal error: Uncaught Error: Attempt to assign property "post_content" on null in .../wp-admin/includes/post.php:795
Stack trace:
#0 .../wp-admin/post-new.php(66): get_default_post_to_edit('page', true)
#1 {main}
thrown in .../wp-admin/includes/post.php on line 795And the underlying cause is that their DB is broken. There is no primary key or auto-increment on the wp_posts table, so WordPress—independently of any plugin or theme—fails to insert a new row when trying to create a draft new post or page.
They need to fix their database problem, and that will almost certainly resolve the issue.
Thanks.
Thanks for the support!
You're welcome.