Skip Navigation

[Resolved] Toolset Maps plugin gives fatal error on Beaver Builder pages

This support ticket is created 2 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 6 replies, has 2 voices.

Last updated by Waqar 2 years, 3 months ago.

Assisted by: Waqar.

Author
Posts
#2438367

Hi,

the Toolset Maps plugin is giving fatal error, when I try to edit a page with Beaver Builder, as on this page the get_current_screen() function returns null.

This is the error message in the log:
PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given in /wp-content/plugins/toolset-maps/includes/toolset-maps-views.class.php:298

I have fixed it by adding a new condition to your function in the mentioned line:
return ( $current_screen && method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() );

Please check the code and add a new condition to check if $current_screen is equal to null, because if it is, than the method_exists() function will return a fatal error.

#2438649

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests on my website with the Beaver Builder and Toolset Maps, but couldn't reproduce this error.

Can you please share the exact steps to reproduce this on a test website or share temporary admin login details, of a website where this can be seen?

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

regards,
Waqar

#2438713

Hi Waqar,

to reproduce the issue, you only need to edit a page with Beaver Builder. If you can't reproduce it, I can create a staging install, where you can test it.

But even if you can not reproduce it, the mentioned code is missing a very important condition to check if $current_screen variable is not equal to null. So it must be fixed anyway.

#2439463

Thanks for writing back and a staging website would be very helpful.

In theory, your suggestion makes sense, but this will allow me in narrowing down the difference between yours and my tests and escalate this with proper steps.

Note: I'm setting your next reply as private so that you can share temporary admin login details.

#2442345

Thank you for sharing the staging website's details.

I see there are a number of other plugins active as well, which would explain, why I wasn't able to reproduce this on a clean test website.

Although the exact steps or cause for the failure of the existing condition is not clear, I've shared your code change recommendation internally for further review so that it can become even more fail-safe.

We appreciate you bringing this to our attention.

#2442373

It is a staging site, so you can disable any other plugin to test this issue more deeply.

#2443073

Thank you for the offer.

We had an internal discussion and due to the nature of your recommended change, it will most likely make it into future releases, without the need for any further investigation.