A bug was discovered during maintenance in our test environment.
Trying to make changes to a content template after upgrading to PHP 8.0 the following message appears in the browser:
"There has been a critical error on this website. Please check your site admin email inbox for instructions."
Turned on debug mode (via WPConfig file):, result in browser:
Required parameter $params follows optional parameter $step in /home/domain/wp-content/plugins/toolset-module-manager/classes/ModuleManager.php on line 611
When reverting to PHP 7.3 everything works normally, The issue occurs with PHP8.0
Hello. Thank you for contacting the Toolset support.
The issue was the content template you set to preview with the post ID 20221 and that post seems deleted hence it was not able to locate that post. I've changed the postmeta key "tb_preview_post" for your content template "Sjabloon voor producten en diensten" (ID: 16662) from the postmeta table to postmeta key "tb_preview_post" equal to the existing post ID 20425.
I can see now it works as expected. Can you please confirm it works at your end as well.
Thanks for your help. I just checked and you fixed the problem on the testing website. The strange thing is that I didn't delete anything and that everything works fine on PHP7.3.
In any case, on the production website this problem occurs 15x.
I've been trying to find out exactly what you did on the testing website, but I can't quite trace it.
How and where exactly did you change these ID numbers? And how do I know which ID number to use? Have you done this in WordPres backend website? Is it possible to send a step-by-step instruction?
I suggest before you do anything with any of your site - please take full backup of your database so in any worst case you will have a backup to restore it.
Yes, it involves the database interaction.
When you visit the content template listing page - you will see the ID column that is the ID of your content template:
=> hidden link
Now, to access the database I've added the "Database Management tool - Adminer" plugin and you should activate that.
=> hidden link
Once you activate the above plugin you can navigate to: Tools => WP adminer and click on button "Open adminer in a new tab"
Now, you will have access to your database and you should try to find the "postmeta" table and you should search for post_id equal to your content template ID. With the found result you should locate the key "tb_preview_post" which will hold the ID of the post with which the content template is set to preview with.
You should check that ID available with postmeta key "tb_preview_post" and see if that post is available or not and change that ID with the existing/available post ID with which you can preview the content template. Please check the following screenshot:
=> hidden link
I hope this is clear and if not then please let me know and I'm happy to help you further.
Thank you for explaining, I have followed your instructions and unfortunately have a few more questions/comments.
1) WP adminer does not show always " tb_preview_post field" when searching Post ID in wp_postmeta.
For example Content template POST ID 17411 (Sjabloon voor transporten) give no result.
2) Suppose there is a field "tb_preview_post field" which ID number should I enter here? How did you know that you had to enter 20425, for example
To be honest I don't feel comfortable with what I'm doing, I'm afraid I'll mess everything up at the public website which going live.
It is also so strange that everything works under PHP 7.3.
1) WP adminer does not show always " tb_preview_post field" when searching Post ID in wp_postmeta.
For example Content template POST ID 17411 (Sjabloon voor transporten) give no result.
==>
The postmeta key "tb_preview_post is available with your content template only if you set your content template to preview with any post before. if not - it will not be there.
2) Suppose there is a field "tb_preview_post" which ID number should I enter here? How did you know that you had to enter 20425, for example
==>
The content template with ID 16662 (Sjabloon voor producten en diensten ) is set to display single post of post type "Products and services (single)" - As you can see with the following screenshot: hidden link
So for that content template - I search in the postmeta table and I found "tb_preview_post" metakey and it holds the value of the post that is not available. So I went to posttype listing page of post type "Products and services" in the backend:
- hidden link
As the content template with ID 16662 (Sjabloon voor producten en diensten ) is set to display single post of post type "Products and services (single)" and then from the post type listing page you can select any existing post ID form this the above list. The post with ID 20425 is top of the list you can see here:
- hidden link
If you have any issues we are welcome to help you.
However - My suggestion before doing any modification in the production website, I suggest you should create a staging site that should be copy of your production website and make the changes and if you see everything working then you can move to production website.
In the meantime I have done investigation and tests that I want to share with you.
I made a copy of an existing content template, I saved it under a different name and this copy could be opened without an error message. But after a while this template didn't open either. I've tried several times, done the same test, the same problem occurs.
Then I created a completely new template (not a copy) and started testing with it.
I have discovered that when a selection is made at the top using "view with" and you leave the content template again (auto-saving), the issue seems to be resolved.
But "views with" is not always visible.
The cause seems now to be clear, it is due to "view with" , I solved my issues on my website now but I wonder if this is normal behavior that "view with" is not always visible.
Thanks for sharing but we do have internal ticket and we are going to improve this mechanism. I'm not able to access the site but in near future we will try to fix this issue as its known to us and already escalated in front of our Devs.