From f55f713395fa04e09712d66bf542d71dc5110194 Mon Sep 17 00:00:00 2001 From: Sudha Bisht Date: Fri, 21 Aug 2015 11:51:00 +0530 Subject: [PATCH] Fix for enable loggin in multisite --- CRM/Logging/Schema.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CRM/Logging/Schema.php b/CRM/Logging/Schema.php index ee88ec526e..4fc1c5c460 100644 --- a/CRM/Logging/Schema.php +++ b/CRM/Logging/Schema.php @@ -63,9 +63,8 @@ class CRM_Logging_Schema { public static function checkLoggingSupport(&$value, $fieldSpec) { $domain = new CRM_Core_DAO_Domain(); $domain->find(TRUE); - $disabled = $domain->locales || !(CRM_Core_DAO::checkTriggerViewPermission(FALSE)); - if ($disabled && $value) { - throw new API_Exception("In order to use this functionality, the installation's database user must have privileges to create triggers (in MySQL 5.0 – and in MySQL 5.1 if binary logging is enabled – this means the SUPER privilege). This install either does not seem to have the required privilege enabled. This functionality cannot be enabled on multilingual installations."); + if (!(CRM_Core_DAO::checkTriggerViewPermission(FALSE)) && $value) { + throw new API_Exception("In order to use this functionality, the installation's database user must have privileges to create triggers (in MySQL 5.0 – and in MySQL 5.1 if binary logging is enabled – this means the SUPER privilege). This install either does not seem to have the required privilege enabled."); } return TRUE; } @@ -416,7 +415,7 @@ AND TABLE_NAME LIKE 'log_civicrm_%' if (!isset($columnsOf[$table]) || $force) { $errorScope = CRM_Core_TemporaryErrorScope::ignoreException(); - $dao = CRM_Core_DAO::executeQuery("SHOW COLUMNS FROM $from"); + $dao = CRM_Core_DAO::executeQuery("SHOW COLUMNS FROM $from", CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); if (is_a($dao, 'DB_Error')) { return array(); } @@ -535,7 +534,7 @@ WHERE table_schema IN ('{$this->db}', '{$civiDB}')"; * Create a log table with schema mirroring the given table’s structure and seeding it with the given table’s contents. */ private function createLogTableFor($table) { - $dao = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE $table"); + $dao = CRM_Core_DAO::executeQuery("SHOW CREATE TABLE $table", CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); $dao->fetch(); $query = $dao->Create_Table; @@ -563,10 +562,10 @@ COLS; $query = self::fixTimeStampAndNotNullSQL($query); $query = preg_replace("/^\) /m", "$cols\n) ", $query); - CRM_Core_DAO::executeQuery($query); + CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); $columns = implode(', ', $this->columnsOf($table)); - CRM_Core_DAO::executeQuery("INSERT INTO `{$this->db}`.log_$table ($columns, log_conn_id, log_user_id, log_action) SELECT $columns, CONNECTION_ID(), @civicrm_user_id, 'Initialization' FROM {$table}"); + CRM_Core_DAO::executeQuery("INSERT INTO `{$this->db}`.log_$table ($columns, log_conn_id, log_user_id, log_action) SELECT $columns, CONNECTION_ID(), @civicrm_user_id, 'Initialization' FROM {$table}", CRM_Core_DAO::$_nullArray, TRUE, NULL, FALSE, FALSE); $this->tables[] = $table; $this->logs[$table] = "log_$table"; -- 2.25.1