Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-21534

Key UI elements fail when fetching activity records from MariaDB

    Details

    • 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 CRM-21455, and was supposed to have been fixed in CiviCRM 4.7.28. However, the patch 11339 contains an error.

      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) {

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kirk Kirk Jackson
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: