CompanyDirectory on CMS 2.2.10 gives 'radians' error

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Lex70000
New Member
New Member
Posts: 5
Joined: Tue Jan 29, 2019 6:51 pm

CompanyDirectory on CMS 2.2.10 gives 'radians' error

Post by Lex70000 »

Updated my CMS version from 2.2.8 on PHP version 5.6.24 to 2.2.10 on PHP version 7.2.14
with working mods : CompanyDirectory: 1.23.5 , Postcode: 1.2.1

My storelocator of the CompanyDirectory module doesn't function anymore.

Get Database Error: EXECUTE(1582) - Incorrect parameter count in the call to native function 'radians'

After a var_dump of cd_company_query($filter) (line 302 of action.search.php file in CompanyDirectory)

I see that ["lat"]=> float(52,3464) ["long"]=> float(4,8977) values are both with a comma float instead with a point float.

In version CMS 228 the var_dump gives floatings with a point. In the database the LAT and LONG are stored as double with a point.

This is causing the error that the mysqli function 'radians' is not working. See line 166 class.cd_company_query.php

$str = '(SELECT 3959 * acos(cos(radians('.$coords['lat'].'))
* cos(radians(C.latitude))
* cos(radians(C.longitude) - radians('.$coords['long'].'))
+ sin(radians('.$coords['lat'].'))
* sin(radians(C.latitude)))) AS distance';

How can I solve this problem ?

Overview of complete var_dump :

["_data":"cd_company_filter":private]=> array(16) { ["id"]=> string(2) "cd" ["sortby"]=> string(12) "company_name" ["sortorder"]=> string(3) "asc" ["pagelimit"]=> int(250) ["page"]=> int(1) ["expiredowners"]=> int(0) ["deep"]=> int(1) ["onlycount"]=> int(0) ["inline"]=> int(0) ["showall"]=> int(0) ["matchall"]=> int(1) ["status"]=> int(-1) ["returnid"]=> int(28) ["radius"]=> float(10) ["lat"]=> float(52,3464) ["long"]=> float(4,8977) }

phpversion: 7.2.14

Cms Version: 2.2.10
CompanyDirectory: 1.23.5
Postcode: 1.2.1
Post Reply

Return to “Modules/Add-Ons”