* Calendar: fix SQL error in eSync with double DISTINCT happening under some conditions

This commit is contained in:
Ralf Becker 2016-08-17 09:25:31 +02:00
parent a98dca4523
commit 26dbe74328

View File

@ -950,7 +950,7 @@ class calendar_so
// we only select cal_table.cal_id (and not cal_table.*) to be able to use DISTINCT (eg. MsSQL does not allow it for text-columns) // we only select cal_table.cal_id (and not cal_table.*) to be able to use DISTINCT (eg. MsSQL does not allow it for text-columns)
foreach(array_keys($selects) as $key) foreach(array_keys($selects) as $key)
{ {
$selects[$key]['cols'] = "DISTINCT $this->repeats_table.recur_type,range_end AS recur_enddate,$this->repeats_table.recur_interval,$this->repeats_table.recur_data,".$this->db->to_varchar($this->cal_table.'.cal_id').",cal_start,cal_end,$this->user_table.cal_recur_date"; $selects[$key]['cols'] = "$this->repeats_table.recur_type,range_end AS recur_enddate,$this->repeats_table.recur_interval,$this->repeats_table.recur_data,".$this->db->to_varchar($this->cal_table.'.cal_id').",cal_start,cal_end,$this->user_table.cal_recur_date";
if (!$params['enum_recuring']) if (!$params['enum_recuring'])
{ {
$selects[$key]['cols'] = str_replace(array('cal_start','cal_end'), $selects[$key]['cols'] = str_replace(array('cal_start','cal_end'),