Fix individual event fetching after saving

This commit is contained in:
Thomas 2011-09-23 14:01:34 +02:00
parent 0736805de6
commit e0951a334f

View file

@ -241,7 +241,6 @@ class database_driver extends calendar_driver
if ($event_id) { if ($event_id) {
$event['id'] = $event_id; $event['id'] = $event_id;
$this->cache[$eventid] = $event;
// add attachments // add attachments
if (!empty($event['attachments'])) { if (!empty($event['attachments'])) {
@ -655,9 +654,10 @@ class database_driver extends calendar_driver
return $this->cache[$id]; return $this->cache[$id];
$result = $this->rc->db->query(sprintf( $result = $this->rc->db->query(sprintf(
"SELECT * FROM " . $this->db_events . " "SELECT e.*, COUNT(a.attachment_id) AS _attachments FROM " . $this->db_events . " AS e
WHERE calendar_id IN (%s) LEFT JOIN " . $this->db_attachments . " AS a ON (a.event_id = e.event_id OR a.event_id = e.recurrence_id)
AND $col=?", WHERE e.calendar_id IN (%s)
AND e.$col=?",
$this->calendar_ids $this->calendar_ids
), ),
$id); $id);