comment fixes
[civicrm-core.git] / CRM / Logging / Schema.php
index ee88ec526e9e58e50d74bddee3513db9d536397c..b36635eef5c20cc87db0ca3b8240a7dd043971f2 100644 (file)
@@ -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;
   }
@@ -188,6 +187,8 @@ AND    TABLE_NAME LIKE 'log_civicrm_%'
 
   /**
    * Drop triggers for all logged tables.
+   *
+   * @param string $tableName
    */
   public function dropTriggers($tableName = NULL) {
     $dao = new CRM_Core_DAO();
@@ -416,7 +417,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 +536,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 +564,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";