Skip Navigation

[Resolved] When adding a "View" I get the error: This block has encountered an error….

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/Hong_Kong (GMT+08:00)

This topic contains 10 replies, has 2 voices.

Last updated by PaigeH5854 1 year, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#2595077

I'm attempting to add a View to a new blank page.

#2595165

Hello,

I have tried it in a fresh WP installation + the latest version of Toolset plugins, it works fine, see below sandbox website:
hidden link

See the page with view block:
hidden link

It works fine. Is there any missing steps? Can your reproduce the same problem in above sandbox website?

If you can not too, there might other compatibility issue in your website, please check these:
1) Backup your website database,
2) Deactivate all other plugins, and switch to WordPress default theme, and test again
3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

#2596479

Good Day Luo,

I've been working with your suggestions and haven't resolved the issue yet, but I will clone the site and delete anything but the bare bones. If I can't find the issue that way, I'll ask you to log on and see if you can find it. Thank you for your patience. - P.

#2596665

Good Day Luo,

The main part of my problem seems to be related to a small piece of code I obtain from Toolset a few years ago. The purpose of this code is to format the numbers in a field to show them as dollars. I'm wondering if there might be something to replace it. This code has been residing in my WP-Config.php file and looks like this:

//* Code to format the price (add thousands comma separator input by Pgrace)
//* See: https://toolset.com/forums/topic/transforming-content-in-number-field-as-price/#post-611859
add_shortcode('format_money', 'sk_format_money');
function sk_format_money( $atts ) {
extract( shortcode_atts( array( 'price' => '0' ), $atts ) );
// $money = number_format( ( float )$price, 2, '.', ',' ); // if you want to show cents; THIS IS THE LINE 33.
$money = number_format( $price );
return $money;
}

From:
https://toolset.com/forums/topic/transforming-content-in-number-field-as-price/#post-611859

Thank you,

#2596717

I have tried these in above sandbox website:
1) Add a custom code snippet:
hidden link
Use same codes as you mentioned above

2) Use the shortcode in view block:
hidden link
[format_money price="[types field='price' output='raw'][/types]"]

It works fine, is there any missing steps?
Did you get any PHP/JS error in your website?

#2596735

Hi Luo,

Unfortunately, the above only resolved some of my issues. I still get an error when attempting to add a new view. So, I've set up a staging site that can be trashed if necessary. I have WordPress 2023 theme loaded and Toolset as my only active plugins. If you go to the Available Puppies or Available Adults page, you'll see that the view works although loading very slowly. However, if you try to create a new page and add a new view, it will consistently throw an error.

I have turned on Views Debug and added the Error_Log code to my wp-config.php file. Unfortunately, non of the above seems to have resolved the problem.

I've set up an admin account for you and am hoping you might see what I've missed.
Here are the account credentials:
hidden link
Username: Toolset-Support
Password: 69iwzdA(RKmmAgZgDshPjsk3

Thank you!

#2596791

There are two Must-Use + one Drop-in plugins in your staging website, all of them can not be deactivate in WordPress dashboard, can you remove them and test again?
If you need more assistance for it, please provide FTP access of the staging website in below private message box

#2597151
view-block.JPG

Thanks for the details, I have done below modifications in your staging website:
1) Upgrade all Toolset plugins to the latest version:
hidden link
2) Create a page, add a new Toolset view block:
hidden link
It works fine, see my screenshot view-block.jpg

You can follow our document to upgrade Toolset plugins in your other website:
https://toolset.com/faq/how-to-install-and-register-toolset/#automatic-installation-once-you-have-otgs-installer-plugin-installed

#2597477

Luo, Thank you very much. I was under the impression that I had the latest Toolset plugin versions. They are all registered on my production website, RoyalworthKennel.com. Do you know why I wouldn't have been flagged that I needed to update? I feel badly to have used all of this support time over the need for an update. Is the OTGS required for me to know that I need to update? All of my plugin say "registered." However, comparing the production site to what you've done I can see that they are out of date, but I don't have a request to update. Thank you for the clarification, - Paige

#2597479

Actually, I just compared. The updates you were kind enough to give me are all even released on your site yet. OK, I'll copy them over manually from the production site. Thank you.

#2597481

My issue is resolved now. Thank you!