Tell us what you are trying to do?
I'm trying to update a content template but when I try to open the template, the request fails with the following error.
WordPress version 6.1.1 Active theme: ListingHive (version 1.2.6) Current plugin: Toolset Blocks (version 1.6.3) PHP version 8.0.27 Error Details ============= An error of type E_ERROR was caused in line 67 of the file /srv/htdocs/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/Sources/PostContent.php. Error message: Uncaught Error: Attempt to assign property "dynamic_sources_content_processed" on null in /srv/htdocs/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/Sources/PostContent.php:67 Stack trace: #0 /srv/htdocs/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/DynamicSources.php(514): Toolset\DynamicSources\Sources\PostContent->get_content(NULL, NULL) #1 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(308): Toolset\DynamicSources\DynamicSources->get_source_content('', '__current_post', 2382, Object(Toolset\DynamicSources\Sources\PostContent)) #2 /wordpress/core/6.1.1/wp-includes/plugin.php(205): WP_Hook->apply_filters('', Array) #3 /srv/htdocs/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/Cache.php(92): apply_filters('toolset/dynamic...', '', '__current_post', '2382', 'post-content') #4 [internal function]: Toolset\DynamicSources\Cache->get_data_for_sources(Array, '__current_post', '2382') #5 /srv/htdocs/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/Cache.php(49): call_user_func_array(Array, Array) #6 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(308): Toolset\DynamicSources\Cache->add_cached_data(Array, '2382') #7 /wordpress/core/6.1.1/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #8 /srv/htdocs/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/DynamicSources.php(967): apply_filters('toolset/dynamic...', Array, 2369) #9 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(308): Toolset\DynamicSources\DynamicSources->get_dynamic_sources_data(Array) #10 /wordpress/core/6.1.1/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #11 /srv/htdocs/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/DynamicSources.php(942): apply_filters('toolset/dynamic...', Array) #12 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(308): Toolset\DynamicSources\DynamicSources->register_localization_data('') #13 /wordpress/core/6.1.1/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #14 /wordpress/core/6.1.1/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #15 /wordpress/core/6.1.1/wp-admin/edit-form-blocks.php(272): do_action('enqueue_block_e...') #16 /wordpress/core/6.1.1/wp-admin/post.php(187): require('/wordpress/core...') #17 {main} thrown
If it helps, this is a sample page that uses the content template: hidden link
The other content templates seems fine, I don't get an error when I try to open the template.
I wanted to update the version of the Toolset plugin in case this is because I'm using a previous version of it but the update option is not there on the plugins page. I've now activated the auto update for Toolset plugins, maybe it would help (?)
ok, I was able to upgrade to the latest version but I still get the same error. Posting the latest stack trace in case there are subtle differences that I didn't notice.
Hello. Thank you for contacting the Toolset support.
This could be because you may have set the content template to view with the specific post for instance "My post" and that post is either deleted or not available.
To fix this issue - would you like to fix it or you want us to fix this. If you want us to fix this can you please share problem URL and admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
The steps are involved the interaction with the database so before doing anything I must say that you should take full backup of your database and website.
In the post meta table you will have to search for the post_id="content template ID" and then you should locate the "tb_preview_post" key and check the value of this key. Then you should take the ID of the post with which you want to preview this content template and set that post ID.