Skip Navigation

[Resolved] ERROR: Template Times out

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 0 reply, has 1 voice.

Last updated by Minesh 1 month, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2807200

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

To be able to edit the template I made a small edit to the file:
plugins/toolset-blocks/application/controllers/shortcode/resolver/conditionals.php

I commented out line 62, part of the process_conditional_shortcodes function:
=> hidden link

	private function process_conditional_shortcodes( $content ) {
		// return apply_filters( 'wpv_process_conditional_shortcodes', $content );
	}

That allowed me to open the template to edit it.

With every content template you are checking post body (post content) using conditional block,
suspecting that is the cause which I already shared before about the checking post body (post content) using conditional block.

I registered a custom function to "Custom Code" section offered by Toolset with code snippet namely "toolset-custom-code" as a simpler custom function to check of whether post content is empty it will return 0 and if not it will return 1:
=> hidden link

function has_content(){
    global $post;
    $return = empty( $post->content ) ? 0 : 1;

    return $return;
}

Then I've replace the conditional block condition where you are checking post body with the custom function has_content():
- hidden link

I've also registered the function has_content at:
=> Toolset => Settings => Front-end Content => Functions inside conditional evaluations
- https://toolset.com/course-lesson/using-toolset-conditional-block/#checking-for-values-from-custom-functions

Then I saved the template, no problem.

I then edited the above file again to restore the line I had commented out.
I un-commented out line 62, part of the process_conditional_shortcodes function and saved the file.
=> hidden link

	private function process_conditional_shortcodes( $content ) {
		 return apply_filters( 'wpv_process_conditional_shortcodes', $content );
	}

Now I can open the template, edit it, save it.
- hidden link
- hidden link

However - I see many incomplete conditionals with the following content template, you can check and fix it as required.
- hidden link

#2807572

"With every content template you are checking post body (post content) using conditional block" What on earth are you talking about? I never write the condition to check for the body, especially not in every template.

So, if you are saying that part of the problem is some strange conditional statement appearing, this needs to be looked at. Let me repeat, and I think I have said this before. I do not write a conditional statement for every template that checks the body content, why would I?

So, before we move on: Show me where I add the conditional block on every template? I mean, when you say every template, I am looking at 10 right now, and I see no conditional statement I added. Which template checks for the body being empty? I see no reason to check whether it is empty or not. If it's empty, it just displays nothing.

Again, I need to understand your reply here because it doesn't make any sense at all.

I have another template that times out. Template 30720

#2807573

Your instructions on how to be able to access templates that time out helped. I was able to recover the new template that timed out by this process.

We still don't know what is causing this. It looks like you are saying it is caused by me adding a condition statement on every template that checks if the body is empty, which is untrue. Definately not for the template I just had issues with.

#2807576

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

For now - with the templates which was having issues that is reported with this ticket, replacing the conditiional block that checked post body (post content) with custom shortcode fixed the issue. This is not from me but our next level support shared this and I shared with you and that also helps to fix the issue.

If you remember - I also help you with the templates where you used Toolset Form block and replaced that with shortcode block having Toolset form shortcode.