if (!isset($ctypes[$table][$field])) {
continue;
}
+ $fldVal = "%{$counter}";
switch ($ctypes[$table][$field]) {
case 'Date':
$value = substr(CRM_Utils_Date::isoToMysql($value), 0, 8);
case 'Timestamp':
$value = CRM_Utils_Date::isoToMysql($value);
break;
+
+ case 'Boolean':
+ if ($value === '') {
+ $fldVal = 'DEFAULT';
+ }
}
$inserts[$field] = "%$counter";
- $updates[] = "$field = %$counter";
- $params[$counter] = array($value, $ctypes[$table][$field]);
+ $updates[] = "{$field} = {$fldVal}";
+ if ($fldVal != 'DEFAULT') {
+ $params[$counter] = array($value, $ctypes[$table][$field]);
+ }
$counter++;
}
if ($changes['log_action'] == 'Delete') {