Map Query Not working

I have one installation where the quick radius map and list map are not working.

The API is good because it plots the address I put in and the test is sucessful

Also, all addresses are geocoded.

However, when I run a list or a map no accounts are selected and I get a query error. I canā€™t paste it in here, because it thinks they are links and wonā€™t save.

Iā€™m on 7.8.12 LTS and I have this feature working on other installations. Iā€™m puzzled? Anyone can point me in the right direction?

I suppose you can paste it inside the forumā€™s ā€œcodeā€ tags, thereā€™s a button on the toolbar to make it easier. Anyway, I often post links and they are allowedā€¦

Is that query error you mention on-screen? Do you get any further errors in your logs?

Hereā€™s the error Iā€™m getting.
Sun Jan 28 13:16:38 2018 [16126][1][FATAL] Query Failed:

SELECT (SQRT((69.1*((accounts_cstm.jjwg_maps_lat_c)-()))(69.1((accounts_cstm.jjwg_maps_lat_c)-()))+(53.0*((accounts_cstm.jjwg_maps_lng_c)-()) * COS(()/57.1))(53.0((accounts_cstm.jjwg_maps_lng_c)-()) * COS(()/57.1)))) AS display_object_distance, accounts.* ,accounts_cstm.trucom_c,accounts_cstm.status_c,accounts_cstm.size_of_company_c,accounts_cstm.shipping_requirements_c,accounts_cstm.chemical_c,accounts_cstm.user_id_c , jt0.user_name modified_by_name , jt0.created_by modified_by_name_owner , ā€˜Usersā€™ modified_by_name_mod , jt1.user_name created_by_name , jt1.created_by created_by_name_owner , ā€˜Usersā€™ created_by_name_mod , jt2.user_name assigned_user_name , jt2.created_by assigned_user_name_owner , ā€˜Usersā€™ assigned_user_name_mod , jt3.name parent_name , jt3.assigned_user_id parent_name_owner , ā€˜Accountsā€™ parent_name_mod , jt4.name campaign_name , jt4.assigned_user_id campaign_name_owner , ā€˜Campaignsā€™ campaign_name_mod, LTRIM(RTRIM(CONCAT(IFNULL(jt5.first_name,ā€™ā€™),ā€™ ā€˜,IFNULL(jt5.last_name,ā€™ā€™)))) servman_c FROM accounts LEFT JOIN accounts_cstm ON accounts.id = accounts_cstm.id_c LEFT JOIN users jt0 ON accounts.modified_user_id=jt0.id AND jt0.deleted=0

AND jt0.deleted=0 LEFT JOIN users jt1 ON accounts.created_by=jt1.id AND jt1.deleted=0

AND jt1.deleted=0 LEFT JOIN users jt2 ON accounts.assigned_user_id=jt2.id AND jt2.deleted=0

AND jt2.deleted=0 LEFT JOIN accounts jt3 ON accounts.parent_id=jt3.id AND jt3.deleted=0

AND jt3.deleted=0 LEFT JOIN campaigns jt4 ON accounts.campaign_id=jt4.id AND jt4.deleted=0

AND jt4.deleted=0 LEFT JOIN users jt5 ON accounts_cstm.user_id_c = jt5.id AND jt5.deleted=0 where ((accounts_cstm.jjwg_maps_lat_c != 0 OR accounts_cstm.jjwg_maps_lng_c != 0) AND (accounts_cstm.jjwg_maps_geocode_status_c = ā€˜OKā€™) AND (SQRT((69.1*((accounts_cstm.jjwg_maps_lat_c)-()))(69.1((accounts_cstm.jjwg_maps_lat_c)-()))+(53.0*((accounts_cstm.jjwg_maps_lng_c)-()) * COS(()/57.1))(53.0((accounts_cstm.jjwg_maps_lng_c)-()) * COS(()/57.1))) < 150.0000)) AND accounts.deleted=0 LIMIT 0,1000: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ā€˜)))(69.1((accounts_cstm.jjwg_maps_lat_c)-()))+(53.0*((accounts_cstm.jjwg_maps_ā€™ at line 1

Sorry had to do it in two posts, I couldnā€™t submit it in one.

I have another installation generating the same kind of error, however, it works in the other installation. So Iā€™m not sure thatā€™s whatā€™s causing this particular problem.

Hi. You could paste it inside the forumā€™s code tags, as I suggested above:

That query has empty parenthesis which are coming from these lines of code:

https://github.com/salesagility/SuiteCRM/blob/master/modules/jjwg_Maps/controller.php#L737-L743

Those variables seem to be empty, when they shouldnā€™t. Your map needs a ā€œcenterā€ but doesnā€™t have one. I donā€™t know what this means, Iā€™m just observing from a quick view at the code.

I would look for an eariler problem, an error just before that one (even if it looks less serious). For some reason the data the map needs isnā€™t ready when it gets to that point in the codeā€¦

Good luck