149 Posts
MtnPavlas
8 years ago
3
Topic

Love the Map template and have been using it for a couple years now. Just recently, though, when I try to load it in a module (rather than in content/component), it fails to load completely and I get the following error (in the Chrome inspect Console): Uncaught ReferenceError: Google is not defined

You can view it on our test site here: https://www.evergreenmtb.org/a-test/education

Through comparing page source for the pages where it does work (component) and where it doesn't (module) I figured out that the Google API does not load, i.e. this code is missing from the head:

<script src="/https://maps.googleapis.com/maps/api/js?sensor=false&language=en" type="text/javascript"></script>

I was able to add a BeforeRender field to the search form of the search/list with a couple lines of code that add this script to the head (which resolves the issue) but it's a work-around, which should not be required.

Anyone else with this issue?

What can I check on or adjust? (E.g. plugin ordering, config, etc.?)

(I have disabled most of the 3rd party plugins, like those for caching, optimizations, etc. but the error prevailed.) Thanks a ton for any pointers.

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
0
Level 1

It is a known bug not fixed yet..

http://www.seblod.com/resources/tracker/22023

149 Posts
MtnPavlas
8 years ago
1
Level 1

Thanks Klas. The interesting part is that it had worked for me for over a year until fairly recently. In case it helps someone, here's my workaround:

Add the BeforeRender field to the search form for the list/search you're trying to display in the module; include this code in this field:

$document = JFactory::getDocument(); 
$document->addScript('https://maps.googleapis.com/maps/api/js?sensor=false&language=en');
4229 Posts
Kadministrator
8 years ago
0
Level 2

Did you chage anything, like turn on Joomla cache?

Get a VIP membership