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.
This commit is contained in:
Aleksander Machniak 2015-01-24 12:58:31 -05:00
parent d7a799da3c
commit 79e07cc1d6

View file

@ -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;