mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
fix new events were created with cal_etag=NULL, which would then also never incremented on update
(because cal_etag=cal_etag+1 for NULL stays NULL). The later is fixed now by using cal_etag=COALESCE(cal_etag,0)+1.
This commit is contained in:
parent
9879e02766
commit
c4f048bbae
@ -1419,7 +1419,7 @@ ORDER BY cal_user_type, cal_usre_id
|
|||||||
if (!is_null($etag)) $where['cal_etag'] = $etag;
|
if (!is_null($etag)) $where['cal_etag'] = $etag;
|
||||||
|
|
||||||
unset($event['cal_etag']);
|
unset($event['cal_etag']);
|
||||||
$event[] = 'cal_etag=cal_etag+1'; // always update the etag, even if none given to check
|
$event[] = 'cal_etag=COALESCE(cal_etag,0)+1'; // always update the etag, even if none given to check
|
||||||
|
|
||||||
$this->db->update($this->cal_table,$event,$where,__LINE__,__FILE__,'calendar');
|
$this->db->update($this->cal_table,$event,$where,__LINE__,__FILE__,'calendar');
|
||||||
|
|
||||||
@ -1436,12 +1436,12 @@ ORDER BY cal_user_type, cal_usre_id
|
|||||||
|
|
||||||
if (!$event['cal_id'] && !isset($event['cal_uid'])) $event['cal_uid'] = ''; // uid is NOT NULL!
|
if (!$event['cal_id'] && !isset($event['cal_uid'])) $event['cal_uid'] = ''; // uid is NOT NULL!
|
||||||
|
|
||||||
|
$event['cal_etag'] = $etag = 0;
|
||||||
$this->db->insert($this->cal_table,$event,false,__LINE__,__FILE__,'calendar');
|
$this->db->insert($this->cal_table,$event,false,__LINE__,__FILE__,'calendar');
|
||||||
if (!($cal_id = $this->db->get_last_insert_id($this->cal_table,'cal_id')))
|
if (!($cal_id = $this->db->get_last_insert_id($this->cal_table,'cal_id')))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$etag = 0;
|
|
||||||
}
|
}
|
||||||
$update = array();
|
$update = array();
|
||||||
// event without uid or not strong enough uid
|
// event without uid or not strong enough uid
|
||||||
|
Loading…
Reference in New Issue
Block a user