Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Critical
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.28
-
Fix Version/s: 4.7.29
-
Component/s: Core CiviCRM
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Core Team Funds
-
Verified?:No
Description
When running on MariaDB, trying to view the Activities dashlet or a contact's Activities tab fails with the error message:
DataTables warning: table id=DataTables_Table_0 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1
This is because the function CRM_Activity_BAO_Activity::deprecatedGetActivities tries to execute an INSERT statement that uses the ANY_VALUE function, which is available in MySQL but not in MariaDB.
This problem was recognised in , and was supposed to have been fixed in CiviCRM 4.7.28. However, the patch 11339 contains an error.CRM-21455
In the patch, the function CRM_Utils_SQL::supportsFullGroupBy tries to detect MariaDB by looking for the string 'mariadb' in the database version string. But it doesn't work because it gets the arguments to stripos() in the wrong order.
It puts the arguments in the order stripos($needle, $haystack), whereas the arguments should be in the order ($haystack, $needle).
Fix: In CRM_Utils_SQL::supportsFullGroupBy(), change the line
if (stripos('mariadb', $version) !== FALSE) {
to
if (stripos($version, 'mariadb') !== FALSE) {