plugins/calendar plugins/libcalendaring
Aleksander Machniak
machniak at kolabsys.com
Tue Sep 3 13:07:25 CEST 2013
plugins/calendar/calendar.php | 3 ++-
plugins/libcalendaring/libcalendaring.php | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit ea949c79923dbb975b12da0dea0c7f899354e78b
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Tue Sep 3 13:06:26 2013 +0200
Fix "PHP Fatal error: Call to a member function setTimezone() on a
non-object" when parsing occurences of recurring events, where
'changed' date is not set (Bug #2185)
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 5c866da..3b8728a 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -1205,7 +1205,8 @@ class calendar extends rcube_plugin
'_id' => $event['calendar'] . ':' . $event['id'], // unique identifier for fullcalendar
'start' => $this->lib->adjust_timezone($event['start'])->format('c'),
'end' => $this->lib->adjust_timezone($event['end'])->format('c'),
- 'changed' => $this->lib->adjust_timezone($event['changed'])->format('c'),
+ // 'changed' might be empty for event recurrences (Bug #2185)
+ 'changed' => $event['changed'] ? $this->lib->adjust_timezone($event['changed'])->format('c') : null,
'title' => strval($event['title']),
'description' => strval($event['description']),
'location' => strval($event['location']),
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index 31b731d..608a527 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -120,7 +120,10 @@ class libcalendaring extends rcube_plugin
else if (is_string($dt))
$dt = new DateTime($dt);
- $dt->setTimezone($this->timezone);
+ if ($dt instanceof DateTime) {
+ $dt->setTimezone($this->timezone);
+ }
+
return $dt;
}
More information about the commits
mailing list