Calendar: Fix attachments duplication when moving an event using database driver
This commit is contained in:
parent
09ef4f6b8c
commit
6b89f751a7
1 changed files with 9 additions and 1 deletions
|
@ -1318,7 +1318,15 @@ class database_driver extends calendar_driver
|
||||||
*/
|
*/
|
||||||
private function add_attachment($attachment, $event_id)
|
private function add_attachment($attachment, $event_id)
|
||||||
{
|
{
|
||||||
$data = $attachment['data'] ? $attachment['data'] : file_get_contents($attachment['path']);
|
if (isset($attachment['data'])) {
|
||||||
|
$data = $attachment['data'];
|
||||||
|
}
|
||||||
|
else if (!empty($attachment['path'])) {
|
||||||
|
$data = file_get_contents($attachment['path']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$query = $this->rc->db->query(
|
$query = $this->rc->db->query(
|
||||||
"INSERT INTO `{$this->db_attachments}`"
|
"INSERT INTO `{$this->db_attachments}`"
|
||||||
|
|
Loading…
Add table
Reference in a new issue