Forum

Thread tagged as: Problem, Error, Runway

Map Not Saving In Perch

Perch Runway: 3.1.1, PHP: 7.2.7, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 38fea24f2847fa7519001be390c98ae0acafe387 $, with PDO
Server OS: Linux, fpm-fcgi
Installed apps: content (3.1.1), assets (3.1.1), categories (3.1.1), perch_blog (5.6.1), perch_events (1.9.5), perch_forms (1.11), chirp_seo (1.2.2), perch_members (1.6.4)
App runtimes: <?php $apps_list = [ 'perch_blog', 'perch_forms', 'perch_events', 'perch_members', 'chirp_seo', ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/teapco/public_html/perch
PERCH_CORE: /home/teapco/public_html/perch/core
PERCH_RESFILEPATH: /home/teapco/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 8M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /home/teapco/public_html
HTTP_HOST: teap.co.uk

I have tried adding Google Maps to a contact page. The Map shows on the page but is centred on the Equator and Greenwich Meridian. In Perch when trying to edit the region the map shows as London and does not accept any postcode entered.

Page debug looks fine but Perch debug is showing:

SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='86d29c7aa884ab60e4385d47aefc3b33' LIMIT 1
UPDATE perch3_users SET userHash='d14ae5e3cbaf7174853d2ea0a47b8658' WHERE userID='1'
[38] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[11] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[1] SELECT * FROM perch3_content_regions WHERE regionID=80 LIMIT 1
[1] SELECT * FROM perch3_pages WHERE pageID='11' LIMIT 1
Using template: /templates/content/contact_map.html
[1] SELECT * FROM perch3_content_items c WHERE c.regionID=80 AND c.itemRev=4 ORDER BY c.itemOrder ASC
Using template: /templates/content/contact_map.html
[1] SELECT * FROM perch3_content_items c WHERE c.regionID=80 AND c.itemRev=4 ORDER BY c.itemOrder ASC
Using template: /templates/content/contact_map.html
Form not posted or did not validate
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[6] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /core/apps/content/modes/edit.form.post.php
Mode: edit.form
Queries: 14
Memory: 4.2852

Then on save even though the postcode is not making the map change to that location I get:

Debug Message - Perch Runway 3.1.1
[1] SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='bdf935c45b79122ded97ab9745978917' LIMIT 1
UPDATE perch3_users SET userHash='4df82b4ba509561e214b5caa4a1eb7d4' WHERE userID='1'
[38] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC
[11] SELECT itemValue FROM perch3_menu_items WHERE itemType='app'
[1] SELECT * FROM perch3_content_regions WHERE regionID=80 LIMIT 1
[1] SELECT * FROM perch3_pages WHERE pageID='11' LIMIT 1
Using template: /templates/content/contact_map.html
[1] SELECT * FROM perch3_content_items c WHERE c.regionID=80 AND c.itemRev=4 ORDER BY c.itemOrder ASC
Using template: /templates/content/contact_map.html
[1] SELECT * FROM perch3_content_items c WHERE c.regionID=80 AND c.itemRev=4 ORDER BY c.itemOrder ASC
Using template: /templates/content/contact_map.html
INSERT INTO perch3_content_items (itemID, regionID, pageID, itemRev, itemOrder, itemJSON, itemSearch, itemUpdatedBy) SELECT itemID, regionID, pageID, 5 AS itemRev, itemOrder, itemJSON, itemSearch, '1' AS itemUpdatedBy FROM perch3_content_items WHERE regionID=80 AND itemRev=4 ORDER BY itemOrder ASC
REPLACE INTO perch3_resource_log (appID, itemFK, itemRowID, resourceID) SELECT cr.appID, cr.itemFK, c2.itemRowID, cr.resourceID FROM perch3_resource_log cr, perch3_content_items c1, perch3_content_items c2 WHERE cr.appID='content' AND cr.itemFK='itemRowID' AND cr.itemRowID=c1.itemRowID AND c1.itemID = c2.itemID AND c1.regionID=80 AND c2.regionID=80 AND c1.itemRev = 4 AND c2.itemRev = 5
[1] SELECT itemRowID FROM perch3_content_items WHERE regionID=80 AND itemRev=5 ORDER BY itemOrder ASC
UPDATE perch3_content_items SET itemOrder=1000 WHERE itemRowID='219'
UPDATE perch3_content_regions SET regionLatestRev=5 WHERE regionID='80'
[1] SELECT regionRev FROM perch3_content_regions WHERE regionID=80
DELETE FROM perch3_content_items WHERE regionID=80 AND itemRev!=4 AND itemRev IN (SELECT itemRev FROM (SELECT DISTINCT itemRev FROM perch3_content_items WHERE regionID=80 ORDER BY itemRev DESC LIMIT 8, 99999) AS t2)
DELETE FROM perch3_resource_log WHERE appID='content' AND itemFK='itemRowID' AND itemRowID NOT IN (SELECT itemRowID FROM perch3_content_items)
[1] SELECT * FROM perch3_content_items WHERE regionID=80 AND itemRev=5 ORDER BY itemOrder ASC
DELETE FROM perch3_resource_log WHERE appID='content' AND itemFK='itemRowID' AND itemRowID='219'
https://maps.googleapis.com/maps/api/geocode/json?address=BB1+2PW&sensor=false&key=AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U
{ "error_message" : "Requests to this API must be over SSL. Load the API with \"https://\" instead of \"https://\".", "results" : [], "status" : "REQUEST_DENIED" }
UPDATE perch3_content_items SET itemJSON='{\"_id\":\"62\",\"map\":{\"adr\":\"BB1 2PW\",\"_title\":\"BB1 2PW\",\"_default\":\"BB1 2PW\",\"lat\":false,\"lng\":false,\"clat\":false,\"clng\":false,\"zoom\":\"15\",\"type\":\"map\",\"admin_html\":\"<img id=\\\"cmsmap219-1\\\" src=\\\"\\/\\/maps.google.com\\/maps\\/api\\/staticmap?key=AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U&center=,&size=460x320&scale=2&zoom=15&maptype=map\\\" width=\\\"460\\\" height=\\\"320\\\" alt=\\\"BB1 2PW\\\">\",\"html\":\"<img id=\\\"cmsmap219-1\\\" src=\\\"\\/\\/maps.google.com\\/maps\\/api\\/staticmap?key=AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U&center=,&size=460x320&scale=2&zoom=15&maptype=map\\\" width=\\\"460\\\" height=\\\"320\\\" alt=\\\"BB1 2PW\\\"><script type=\\\"text\\/javascript\\\">\\/* <![CDATA[ *\\/ if(typeof CMSMap ==\'undefined\'){\\n var CMSMap={};\\n CMSMap.maps=[];\\n var s = document.createElement(\'script\');\\n s.setAttribute(\'src\', \'\\/perch\\/core\\/assets\\/js\\/public_maps.min.js\');\\n document.body.appendChild(s);\\n }CMSMap.maps.push({\'mapid\':\'cmsmap219-1\',\'width\':\'\',\'height\':\'\',\'type\':\'map\',\'zoom\':\'15\',\'adr\':\'BB1 2PW\',\'lat\':\'\',\'lng\':\'\',\'clat\':\'\',\'clng\':\'\'});CMSMap.key=\'AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U\';\\/* ]]> *\\/<\\/script>\"}}', itemSearch=' BB1 2PW ' WHERE itemRowID='219'
[1] SELECT * FROM perch3_content_items c WHERE c.regionID=80 AND c.itemRev=5 ORDER BY c.itemOrder ASC
[1] Using template: /templates/content/contact_map.html
UPDATE perch3_content_regions SET regionHTML='<div class=\"big_map\">\n \n <img id=\"cmsmap219-1\" src=\"//maps.google.com/maps/api/staticmap?key=AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U&center=,&size=460x320&scale=2&zoom=15&maptype=map\" width=\"460\" height=\"320\" alt=\"BB1 2PW\"><script type=\"text/javascript\">/* <![CDATA[ */ if(typeof CMSMap ==\'undefined\'){\n var CMSMap={};\n CMSMap.maps=[];\n var s = document.createElement(\'script\');\n s.setAttribute(\'src\', \'/perch/core/assets/js/public_maps.min.js\');\n document.body.appendChild(s);\n }CMSMap.maps.push({\'mapid\':\'cmsmap219-1\',\'width\':\'\',\'height\':\'\',\'type\':\'map\',\'zoom\':\'15\',\'adr\':\'BB1 2PW\',\'lat\':\'\',\'lng\':\'\',\'clat\':\'\',\'clng\':\'\'});CMSMap.key=\'AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U\';/* ]]> */</script>\n</div>\n', regionRev=5, regionLatestRev=5 WHERE regionID='80'
Setting alert: Content successfully updated (success)
[nil] SELECT * FROM perch3_resources WHERE resourceApp='content' AND resourceInLibrary=0 AND resourceCreated<'2018-06-28 17:18:24' AND resourceID NOT IN (SELECT resourceID FROM perch3_resource_log)
[1] SELECT MIN(itemRev) FROM perch3_content_items WHERE regionID=80
DELETE FROM perch3_content_index WHERE regionID=80 AND itemRev<0
[1] SELECT * FROM perch3_content_items WHERE regionID=80 AND itemRev=5 ORDER BY itemOrder ASC
DELETE FROM perch3_content_index WHERE regionID=80 AND itemRev=5
Using template: /templates/content/contact_map.html
INSERT INTO perch3_content_index (itemID, regionID, pageID, itemRev, indexKey, indexValue) VALUES (62,80,11,5,'map','BB1 2PW'),(62,80,11,5,'map_adr','BB1 2PW'),(62,80,11,5,'map__title','BB1 2PW'),(62,80,11,5,'map__default','BB1 2PW'),(62,80,11,5,'map_lat',''),(62,80,11,5,'map_lng',''),(62,80,11,5,'map_clat',''),(62,80,11,5,'map_clng',''),(62,80,11,5,'map_zoom','15'),(62,80,11,5,'map_type','map'),(62,80,11,5,'map_admin_html','<img id=\"cmsmap219-1\" src=\"//maps.google.com/maps/api/staticmap?key=AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U&center=,&size=460x320&scale=2&zoom=15&maptype=map\" width=\"460\" height=\"320\" alt=\"BB1 2PW\">'),(62,80,11,5,'map_html','<img id=\"cmsmap219-1\" src=\"//maps.google.com/maps/api/staticmap?key=AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U&center=,&size=460x320&scale=2&zoom=15&maptype=map\" width=\"460\" height=\"320\" alt=\"BB1 2PW\"><script type=\"text/javascript\">/* <!'),(62,80,11,5,'_id',62),(62,80,11,5,'_order','1000')
[1] OPTIMIZE TABLE perch3_content_index
UPDATE perch3_pages SET pageModified='2018-06-29 17:18:24' WHERE pageID='11'
Using template: /templates/content/contact_map.html
[1] SELECT * FROM perch3_content_items c WHERE c.regionID=80 AND c.itemRev=5 ORDER BY c.itemOrder ASC
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1
[6] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC
[1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1
[1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10
[2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC
File: /core/apps/content/modes/edit.form.post.php
Mode: edit.form
Queries: 47
Memory: 4.2885

This contains the error that I suspect is the problem but I don't know where that is coming from???

https://maps.googleapis.com/maps/api/geocode/json?address=BB1+2PW&sensor=false&key=AIzaSyAfMCip-o7bQAxHY3LoxkQpPmTAS6Hq59U
{ "error_message" : "Requests to this API must be over SSL. Load the API with \"https://\" instead of \"https://\".", "results" : [], "status" : "REQUEST_DENIED" }

Any ideas please and thank you!

Greg Riley

Greg Riley 1 points

  • 3 years ago

Update. I added an API key from another older site and it works.