plugins/calendar

Thomas Brüderli bruederli at kolabsys.com
Mon Jan 27 11:25:29 CET 2014


 plugins/calendar/drivers/database/database_driver.php |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 028c21f4ca55517d5365396082edc1027e97a058
Author: Thomas Bruederli <thomas at roundcube.net>
Date:   Mon Jan 27 11:25:17 2014 +0100

    DB driver: accept categories field to be an array. libcalendaring ical parser provides array values here (#2797)

diff --git a/plugins/calendar/drivers/database/database_driver.php b/plugins/calendar/drivers/database/database_driver.php
index f1c6396..43c2e1b 100644
--- a/plugins/calendar/drivers/database/database_driver.php
+++ b/plugins/calendar/drivers/database/database_driver.php
@@ -254,7 +254,7 @@ class database_driver extends calendar_driver
         strval($event['title']),
         strval($event['description']),
         strval($event['location']),
-        strval($event['categories']),
+        join(',', (array)$event['categories']),
         strval($event['url']),
         intval($event['free_busy']),
         intval($event['priority']),
@@ -470,6 +470,8 @@ class database_driver extends calendar_driver
     foreach ($set_cols as $col) {
       if (is_object($event[$col]) && is_a($event[$col], 'DateTime'))
         $sql_set[] = $this->rc->db->quote_identifier($col) . '=' . $this->rc->db->quote($event[$col]->format(self::DB_DATE_FORMAT));
+      else if (is_array($event[$col]))
+        $sql_set[] = $this->rc->db->quote_identifier($col) . '=' . $this->rc->db->quote(join(',', $event[$col]));
       else if (isset($event[$col]))
         $sql_set[] = $this->rc->db->quote_identifier($col) . '=' . $this->rc->db->quote($event[$col]);
     }




More information about the commits mailing list