Skip Navigation

[Resolved] MAPS: This Block has Encountered an error and cannot be previewed

This thread is resolved. Here is a description of the problem and solution.

Problem:
The customer reported that the Toolset Maps block is showing the error message 'This Block has Encountered an error and cannot be previewed'.

Solution:
Guided that there was a console error related to the missing Google Maps API key. The Google Maps API key was set in Toolset's map settings, but not in the Divi theme.

Disabling the "Enqueue Google Maps Script" option from WP Admin -> Divi -> Theme Options -> General fixed the block error.

Relevant Documentation:
n/a

This support ticket is created 2 years, 6 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.

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

Last updated by Zeb H. 2 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2384951

I am trying to:
Insert a map to show the corresponding addresses in my View. Right now I add a map and I get the error 'This Block has Encountered an error and cannot be previewed'... and I can't adjust any settings.

Link to a page where the issue can be seen:
hidden link

I expected to see:
Markers in the locations for the posts on that pages View.

Instead, I got:
An error message, and a map that is not localized.

#2385205

Hi,

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

To troubleshoot this, I'll need to see how this view and the map block are set up in the admin area.

Can you please share temporary admin login details, in reply to this message?

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

regards,
Waqar

#2386209

Thank you for sharing the access details, but your website seems to be inaccessible, with the error message:
"Error establishing a database connection"

Can you please consult with your web host and let me know once it is back online?

#2386675

Oh! Ok, I think this is resolved now - I've moved the site to a new location...
hidden link

Same credentials, login: hidden link

#2387289

The new website's access details worked, thank you.

I noticed that some console errors were showing related to the missing Google Maps API key. The Google Maps API key was set in Toolset's map settings, but not in the Divi theme.

I've disabled the "Enqueue Google Maps Script" option from WP Admin -> Divi -> Theme Options -> General and the Maps block error is fixed.

#2387573

Great! I didn't realize the Divi map was conflicting, thanks for helping figure that out!!

Now, I've just figured out how to add information when clicking a Map Marker, seen here: hidden link
What I can't seem to get working is opening a new tab when clicking a url. How can I essentially add, <target="_blank">

Here's the code I'm putting in the pop-up:
[wpv-post-title]
<br />
[types field='location-display'][/types]
<br />
[types field='website-display'][/types]

#2389125

Glad that I was able to help.

To make the link from the "URL" type field, open in a new tab, you can include the target='_blank' attribute:
( ref: https://toolset.com/documentation/customizing-sites-using-php/functions/#url )

For example:


[types field='website-display' target='_blank'][/types]

#2389281

Oh great! That was a much easier fix than I thought. Thanks for the link to the tutorial too.
Cheers!!

#2389283

My issue is resolved now. Thank you!