Forum

Thread tagged as: Problem

PERCH_GMAPS_API_KEY not updating

Hi I am getting a problem with the API Key in the config file not actually then being used on the page where I am trying to render the map. When I look at the Javascript consol, the API key that perch is passing to google maps isn't matching the one in my config file. I have tried switching debug on and there is no error showing up in the debug.

Debug Message - Perch 3.1.1
[36] SELECT DISTINCT settingID, settingValue FROM perch3_settings WHERE userID=0
[10] SELECT regionKey, regionHTML FROM perch3_content_regions WHERE regionPage='/contact.php' OR regionPage='*' ORDER BY regionPage DESC
[5] SELECT * FROM perch3_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch3_pages WHERE pagePath='/contact.php' LIMIT 1
[3] SELECT pageID FROM perch3_pages WHERE pageTreePosition IN ('000-001-001-002', '000-001-001', '000-001', '000') ORDER BY pageTreePosition DESC
[5] Using template: /templates/navigation/item.html
[5] SELECT * FROM perch3_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch3_pages WHERE pagePath='/contact.php' LIMIT 1
[3] SELECT pageID FROM perch3_pages WHERE pageTreePosition IN ('000-001-001-002', '000-001-001', '000-001', '000') ORDER BY pageTreePosition DESC
[5] Using template: /templates/navigation/dropdownnav.html
[1] SELECT groupID FROM perch3_navigation WHERE groupSlug='footer-navigation' LIMIT 1
[4] SELECT np.pageID, np.pageParentID, p.pagePath, p.pageTitle, p.pageNavText, p.pageNew, p.pageOrder, np.pageDepth, p.pageSortPath, np.pageTreePosition, p.pageAccessTags, p.pageAttributes FROM perch3_navigation_pages np, perch3_pages p WHERE p.pageID=np.pageID AND np.groupID=1 AND p.pageNew=0 AND np.pageDepth >=0 AND np.pageDepth<=1 ORDER BY np.pageTreePosition ASC
[1] SELECT np.pageTreePosition FROM perch3_pages p, perch3_navigation_pages np WHERE np.pageID=p.pageID AND np.groupID=1 AND p.pagePath='/contact.php' LIMIT 1
[1] SELECT pageID FROM perch3_navigation_pages WHERE groupID=1 AND pageTreePosition IN ('000-002', '000') ORDER BY pageTreePosition DESC
[4] Using template: /templates/navigation/item.html
[1] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch3_blog_index idx JOIN perch3_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch3_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='postDateTime' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2018-06-13 11:04:00' ) GROUP BY itemID, sortval ORDER BY sortval DESC LIMIT 0, 1
[1] SELECT FOUND_ROWS() AS `count`
[1] Using template: /templates/blog/post_exerpt_in_list.html
[1] SELECT * FROM perch3_blog_sections ORDER BY sectionTitle ASC
[1] SELECT * FROM perch3_blogs ORDER BY blogTitle ASC

The javascript consol error looks like this:


(anonymous) @ contact.php:208 (anonymous) @ contact.php:209 contact.php:115 GET https://maps.google.com/maps/api/staticmap?key=ABQIAAAAWMg9zhGOGc0x8slYXa-esRTO_wfIN1AnxHKX9GlPehLcDTDyPRQnx2XQgGslzCrTe5Rpa8GryID91g&center=,&size=560x300&scale=2&zoom=15&maptype=map 403 () js?key=ABQIAAAAWMg9zhGOGc0x8slYXa-esRTO_wfIN1AnxHKX9GlPehLcDTDyPRQnx2XQgGslzCrTe5Rpa8GryID91g:39 Google Maps JavaScript API error: InvalidKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key-map-error _.Hb @ js?key=ABQIAAAAWMg9zhGOGc0x8slYXa-esRTO_wfIN1AnxHKX9GlPehLcDTDyPRQnx2XQgGslzCrTe5Rpa8GryID91g:39 (anonymous) @ common.js:54 (anonymous) @ common.js:151 c @ common.js:48 (anonymous) @ AuthenticationService.Authenticate?1shttps%3A%2F%2Fwww.theloaf.co.uk%2Fcontact.php&4sABQIAAAAWMg9zhGOGc0x8slYXa-esRTO_wfIN1AnxHKX9GlPehLcDTDyPRQnx2XQgGslzCrTe5Rpa8GryID91g&callback=_xdc_._uesh7d&token=6899:1 js?key=ABQIAAAAWMg9zhGOGc0x8slYXa-esRTO_wfIN1AnxHKX9GlPehLcDTDyPRQnx2XQgGslzCrTe5Rpa8GryID91g:61 GET https://maps.googleapis.com/maps-api-v3/api/js/33/3/intl/en_gb/stats.js 0 ()

I don't know where else in the perch script it is getting this key 'ABQI....' etc.

I have already republished the pages.

Thanks for any pointers.

Andrew

Andrew Auld

Andrew Auld 0 points

  • 2 months ago
Drew McLellan

Drew McLellan 2578 points
Perch Support

Does it make a difference if you click Save on the map region?

Drew McLellan said:

Does it make a difference if you click Save on the map region?

Hi Drew, Not sure what you mean by this. Andrew

Drew McLellan

Drew McLellan 2578 points
Perch Support

Go to the place in the control panel where your map is defined and click Save.

Drew, This still hasn't worked. Do you have any other ideas? Thanks

Drew McLellan

Drew McLellan 2578 points
Perch Support

Have you searched your project for the invalid API key?