Skip Navigation

[Resolved] Split: Conditional block crashing the content template

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Waqar 1 year, 2 months ago.

Assisted by: Waqar.

Author
Posts
#2645937

Hi Minesh,
I have restored the database and I/you can reopen the page now. But when I try to add a Conditional block to test if the Post content is empty or not and save the content template then it crashes and I get an email from WP saying that it had a critical issue in Toolset Blocks. I think that the issue arises if the conditional is set to check a WP standard field and not a Toolset custom field. I've used many conditionals in many pages so far, all to test Toolset custom fields and I never had any issue.
thanks
Regards
Nicola
PS - understand it's a different issue, if you want to open another ticket it's ok for me. And please reopen the private section, thanks

#2645957

Hi Nicola,

Do you get any details of the errors or warnings in the email from WordPress or in the server's error logs?
( ref: https://wordpress.org/documentation/article/debugging-in-wordpress/ )

In case there are no errors or warnings, you're welcome to share temporary admin login details, along with the exact steps to see the issue.
( I'll also need your permission to download the clone/snapshot of the website, in case it needs to be investigated on a different server )

Note: Your next reply will be private and it is recommended to make a complete backup copy before sharing the access details.

regards,
Waqar

#2646579

Thank you for sharing these details.

I was able to reproduce the issue in the content template that you specified, but not on my test website. And I think I have an idea of what is happening.

There are about 70 active plugins on your website, and any one of them could be adding filters to the post content/body.

When calling the post body/content through the 'wpv-post-body' shortcode, the suppress_filters='true' attribute can be used to avoid that.
( https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body )

But in the conditional block's interface for the post content/body check same attribute can't be applied.

I'll recommend recovering the content template and then trying the advanced editor option in a conditional block to test the manually constructed condition like this:


NOT ( empty( '[wpv-post-body view_template='None' suppress_filters='true']') )

If that also brings in the same result, you can add a special class to this grey row/section that is set to show the content/body and not wrap it inside any conditional block.

Instead, add a 'Fields and Text' block, and in its HTML tab, include a conditional statement like this:


[wpv-conditional if="( empty( '[wpv-post-body view_template='None' suppress_filters='true']') ) "]
<style>
  custom CSS code
</style>
[/wpv-conditional]

In place of the 'custom CSS code', you can include CSS style to hide the grey row/section with the special class, which will only work when the condition is true, i.e. the content/body is empty.