Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using default calender configuration not working #14

Open
daincredibleholg opened this issue Mar 31, 2017 · 7 comments
Open

Using default calender configuration not working #14

daincredibleholg opened this issue Mar 31, 2017 · 7 comments

Comments

@daincredibleholg
Copy link

It looks like the Roundcube API changed.

This is tested with Roundcube 1.2.4 (using the complete package, if it has any importance) and todays HEAD of master (aka creating a fresh clone from the repository).

Once I add this to the plugins config.inc.php, it blows:

$config['calendar_preinstalled_calendars'] = array(
    'Caldav' => array(
                    'driver'      => 'caldav',
                    'caldav_user' => '%u',
                    'caldav_pass' => '%p',
                    'caldav_url'  => 'https:/cloud.mydomain.example/',
                    'color'       => 'cccc00',
                    'showAlarms'  => 1),
);

The error from Roundcubes error log is:

[31-Mar-2017 09:20:12 +0200]: PHP Error: Failed to load plugin file /var/www/htdocs/plugins/carddav/carddav.php in /var/www//htdocs/program/lib/Roundcube/rcube_plugin_api.php on line 173 (GET /?_task=calendar)
[31-Mar-2017 09:20:12 +0200]: PHP Error: Failed to load plugin file /var/www/htdocs/plugins/contextmenu/contextmenu.php in /var/www/htdocs/program/lib/Roundcube/rcube_plugin_api.php on line 173 (GET /?_task=calendar)
[31-Mar-2017 09:20:12 Europe/Berlin] PHP Fatal error:  Call to undefined method caldav_driver::insert_default_calendar() in /var/www/htdocs/plugins/calendar/calendar.php on line 182

And, more or less the short version, from the apache error log:

[Fri Mar 31 09:16:59.888865 2017] [:error] [pid 4478] [client 213.205.198.198:45818] PHP Fatal error:  Call to undefined method caldav_driver::insert_default_calendar() in /var/www/htdocs/plugins/calendar/calendar.php on line 182

Searching through the code base shows that there is no caldav_driver::insert_default_calendar() function indeed.

@shpokas
Copy link

shpokas commented May 29, 2017

No, insert_default_calendar() along with a few other functions are omitted from file calendar/drivers/caldav/caldav_driver.php
Why? Keine Ahnung.

@andrewhotlab
Copy link

I'm not a developer, but I just managed to make it work again, by comparing the file calendar/drivers/caldav/caldav_driver.php with the one from feature_caldav branch of the Kolab repository.

I made a patch which works for me, but I do not know how to create a pull request, so I attached the file here.
I'll be grateful if a developer can check it out and commit it. It will also be a good plus if the result could be published in the Roundcube Plugins web page.

@archont00
Copy link

Nice work. I was able to get https://github.com/texxasrulez/Caldav_Calendar/ working, unfortunately the bug with timezones was a show stopper texxasrulez/caldav_calendar#19
I wonder, if "fasterit" caldav code base suffers the same bug or not.

@andrewhotlab
Copy link

Sorry, I posted it here, but actually the patch was created for the dotplex/roundcube_calendar fork (in the meanwhile, I managed to create my first pull request).
I used that fork because they fixed the issue #15, which was preventing me to have the plugin work.

@archont00
Copy link

I see. And do the timezones work for you?

@andrewhotlab
Copy link

Yes, the .ics file I can download from Roundcube contains all timezone details.
Actually my Roundcube instance is using Cyrus IMAP's CalDAV module as back end, not Nextcloud's app, but it shouldn't make any difference for the bug you mention in texxasrulez/caldav_calendar#19, does it?

@archont00
Copy link

archont00 commented Dec 11, 2018

It works even with roundcube 1.4 (elastic - but only with larry or classic themes). I use docker (official) and had to additionally install mcrypt extension which became disabled in php 7.1 (and removed in php 7.2): https://askubuntu.com/questions/1031921/php-mcrypt-package-missing-in-ubuntu-server-18-04-lts

The only trouble is the default time zone - caldav plugin converts the time to UTC timezone and does not save any info about the timezone.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Roundcube libcalendaring 1.4-git//Sabre//Sabre VObject 2.1.7//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
UID:DCDF83EFF8FF2891CDA8D4085AFB3AE5-44A014B8E8E6E4A8
DTSTAMP;VALUE=DATE-TIME:20181211T210757Z
CREATED;VALUE=DATE-TIME:20181211T210749Z
LAST-MODIFIED;VALUE=DATE-TIME:20181211T210749Z
DTSTART;VALUE=DATE-TIME:20181212T083000Z
DTEND;VALUE=DATE-TIME:20181212T090000Z
SUMMARY:Test3
SEQUENCE:0
TRANSP:OPAQUE
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR

E.g. new event 09:30-10:30 is shown as such in roundcube/calendar, and also in nextcloud calendar I can see 09:30-10:30 in the calendar view.
However, when I try to edit, nexctloud shows UTC timezone and time 08:30-09:00 (Obviously, this is the same time - but very unfriendly to edit time in a different timezone.)

Is there a way how to deal with that? (This might rather be nexctloud calendar app issue, though.)

EDIT: It is a valid behaviour to save DATE-TIME in UTC (which is indicated by "Z"). Clients seem to deal with that differently:

  • RC calendar shows the time in local time zone and saves in UTC. Even if the ics was created in another client providing full time zone data, standard and dst, etc., rc calendar strips everything and re-saves in UTC. Not a very good behaviour.
  • Nextcloud web calendar shows the time in local time zone, but edits in the time zone saved in ics (might be any time zone, but in ics from RC calendar it is always UTC). Confusing.
  • Android aCalendar shows the time in local time zone, however when editing it shows that ics is in UTC and also re-calcs the time to local time zone - so both times are shown. This is neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants