From 79e07cc1d6531f31ddb85874fba6b4596934005f Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 24 Jan 2015 12:58:31 -0500 Subject: [PATCH] Fix bug where removing attachment in event dialog wasn't possible after upload (#4288) When redundant_attachments or database_attachments plugin was enabled the ID of uploaded file contained ":" character which was invalid in HTML and css selector didn't work. --- plugins/calendar/calendar.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index cde78fc8..db61d474 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -1756,7 +1756,7 @@ class calendar extends rcube_plugin */ public function attachment_upload() { - $this->lib->attachment_upload(self::SESSION_KEY, 'cal:'); + $this->lib->attachment_upload(self::SESSION_KEY, 'cal-'); } /** @@ -1820,7 +1820,8 @@ class calendar extends rcube_plugin } $attachments = array(); - $eventid = 'cal:'.$event['id']; + $eventid = 'cal-'.$event['id']; + if (is_array($_SESSION[self::SESSION_KEY]) && $_SESSION[self::SESSION_KEY]['id'] == $eventid) { if (!empty($_SESSION[self::SESSION_KEY]['attachments'])) { foreach ($_SESSION[self::SESSION_KEY]['attachments'] as $id => $attachment) { @@ -2957,7 +2958,7 @@ class calendar extends rcube_plugin } // copy mail attachments to event else if ($message->attachments) { - $eventid = 'cal:'; + $eventid = 'cal-'; if (!is_array($_SESSION[self::SESSION_KEY]) || $_SESSION[self::SESSION_KEY]['id'] != $eventid) { $_SESSION[self::SESSION_KEY] = array(); $_SESSION[self::SESSION_KEY]['id'] = $eventid;