Hi there,
I'm trying to edit a specific Content Template on my website ("Content template for Clients 4"). The edit link is below:
hidden link
When I try to access the page, the web browser appears to stall until PHP times out. See the attached screenshot. (This screenshot is actually from a copy of the website that lives on my desktop computer and suffers from the same issue.)
I've disabled all plugins except Toolset Types and Toolset Blocks and tried to edit the content template, without success. I have exported the Types settings and re-imported them, and trying to edit the content template then was still unsuccessful.
Perhaps I can provide server credentials for you to access my site?
Thank you.
Saul
PS. To work around this issue, I have duplicated the Content Template and edited the duplicate copy. After editing the duplicate content template once, it is no longer editable. If I try to edit it again, the same script timeout as pictured in the screenshot will appear.
Hello,
The problem you mentioned above is abnormal, please provide a copy of your website in below private message box, you can put the package files in your own google drive disk, share the link only, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/
I am downloading the files, will update here if find anything
I assume you are going to check the post content is empty, then output something.
If it is, please try these:
1) Add below codes into your theme file functions.php
function wpv_is_content_empty(){
global $post;
$content = force_balance_tags($post->post_content);
$content = preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content); // remove empty HTML P AND BR tags
$content = preg_replace('/<!--(.*)-->/Uis', '', $content); // remove empty HTML comment tag <!-- -->
$content = trim($content);// remove empty spaces
if (strlen( $content ) == 0){
return 1;
} else {
return 0;
}
}
2) Dashboard-> Toolset-> Settings-> Front-end Content, in section "Functions inside conditional evaluations", add above PHP function name: wpv_is_content_empty
3) Trash and remove the problem content template "Content template for Clients 4", create a new content template, and setup the conditional block with below condition:
The result of ts_is_content_empty() is equal to 0.
See my screenshot not-empty-body.JPG
Luo,
Thanks for your reply. I'm very confused. You mentioned that you're assuming I'm "going to check [if] the post content is empty, then output something." I'm not trying to do that. I'm simply trying to edit the Content Template: I'm clicking the title of the template on the WordPress dashboard (see attached), waiting several minutes, and seeing the PHP error.
Is there something I'm missing?
Saul
I have checked it in database, in the "Content template for Clients 4", there is a conditional block is using setting: check the post content is empty
It using [wpv-post-body ...] shortcode in the condition, and conduct endless loop issue, and conduct the problem you mentioned above.
Please try as I mentioned above:
Trash and remove the problem content template "Content template for Clients 4", create a new content template
https://toolset.com/forums/topic/php-fatal-error-when-trying-to-edit-a-content-template/#post-2199331
If you don't need to check the post body, then you just need setup it again manually.
This seems to have fixed the issue. I'm able to view the edit page of the content template repeatedly. So odd, but thank you!