After updating plugin to version 2.11.0.4, a critical error appears on the site frontend. The error is: Fatal error: Uncaught Error: Class “FLThemeBuilderRulesLocation” not found.
You can fix this by editing /wp-content/plugins/beaver-builder-lite-version/modules/popup/popup.php. Wrap that function call in class_exists() so it won’t crash if you’re not using the paid version.
private static function check_themer_layout(): bool {
$post = [];
if ( class_exists( 'FLThemeBuilderRulesLocation' ) ) {
$rules = FLThemeBuilderRulesLocation::get_current_page_location();
}
// $post = FLThemeBuilderRulesLocation::get_preview_original_post();
return $post && 'fl-theme-layout' === $post->post_type;
}
....
Thank you for solution.
Thanks for the fast response! I’ll try it out
Hi Charlie, thanks for the solution. I opened the file, but a little confused as where to add the update
You can simply replace the function entirely:
private static function check_themer_layout(): bool {
$post = [];
if ( class_exists( 'FLThemeBuilderRulesLocation' ) ) {
$rules = FLThemeBuilderRulesLocation::get_current_page_location();
}
// $post = FLThemeBuilderRulesLocation::get_preview_original_post();
return $post && 'fl-theme-layout' === $post->post_type;
}
I’m with Mike - when you say to replace the function…where do we put that? Do we open a specific page to find where it goes? I’m okay with basics on website building, but (like others!) I use the plug-in because I don’t do coding.
Open this file via FTP: /wp-content/plugins/beaver-builder-lite-version/modules/popup/popup.php
On line 161, you’ll find a function called private static function check_themer_layout(): bool {
replace it entirely up to the closing curly brace with the one I posted above.
I got it now, thanks! I just searched for ‘private static function check_themer_layout()’ and just replaced that section and it worked fine. I’m not sure why the latest update did that. I never had any issues with Beaver Builder before in years. Maybe they want you to purchase the Paid version.
Thanks again for your help!
Could you tell me how to find this if I am using Wordpress?
I was able to replace the function as suggested and our website began working again immediately. However, now when we login to the WPAdmin and try to edit any page using Beaver Builder, we get the same message, “There has been a critical error on this website.” So website works but the plug-in doesn’t.
Where did you do this in WPAdmin? Thanks!
The update to the function has to be done in the popup.php file. I don’t know that it can be done through WordPress. I logged on to our hosting account and used the file viewer to find and update the file.