-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 13
-
Fix Version/s: 14
-
Component/s: Core, Follow Me, RESTful API
-
Labels:None
-
ToDo:
-
Asterisk Version:13
-
Distro Version:8.6 (Jessie)
-
Distro:Self Install Debian
When using FreePBX 13 on MySQL 5.7.16, it fails to write the asterisk config files. It stops writing them when trying to write sip_additional.conf.
The problem lies in ./modules/core/functions.inc.php . There are several SQL queries like:
$sql = "SELECT data,id from $table_name where keyword='account' and flags <> 1 group by data";
On MySQL versions <5.7.5 that "group by" clause was accepted, but on newer versions it fails with the following error:
ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'asterisk.sip.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
(more info in https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html )
The fix suggested in dev.mysql.com is changing
$sql = "SELECT data,id from $table_name where keyword='account' and flags <> 1 group by data";
to
$sql = "SELECT data,ANY_VALUE(id) as id from $table_name where keyword='account' and flags <> 1 group by data";
I've done that in generate_sip_additional, generate_iax_additional and generate_zapata_additional and it works flawlessly.