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

Baikal sets cal:calendar-timezone to a timezone string instead of a VTIMEZONE when creating a new calendar via the web UI #1241

Open
apollo-sturdy opened this issue Feb 23, 2024 · 11 comments

Comments

@apollo-sturdy
Copy link

Baikal version: 0.9.4

Expected behaviour:

Baikal should set the field to a correct iCalendar object with a VTIMEZONE. This causes the following bug: #1085 which causes integrations to fail with Cal.com and HomeAssistant.

Current behaviour:

Baikal sets the field to the timzone string from the settings.

Steps to reproduce:

  1. Install Baikal
  2. Create new calendar
  3. Check cal:calendar-timezone field
@apollo-sturdy
Copy link
Author

For any readers here, as a temporary fix you can re-create your calendars in iCal (MacOS Calendar app): #1085 (comment)

@nepomuc
Copy link

nepomuc commented Feb 24, 2024

Please fix this. I don't have iCal. :/

@fr567
Copy link

fr567 commented May 18, 2024

I'm also very intererested in getting a solution for the manual installation on a webhosting service.

@fr567
Copy link

fr567 commented May 18, 2024

I'm also very intererested in getting a solution for the manual installation on a webhosting service.

I replaced the baikal\vendor\sabre\dav\lib\CalDAV\Plugin.php from the release baikal-0.9.5.zip with the the baikal-docker-hass/files/Plugin.php and now it works also with Home Assistant.

@pegelow
Copy link

pegelow commented Jul 2, 2024

You ca solve the problem like this:

edit the baikal-file: /vendor/sabre/dav/lib/CalDAV/Plugin.php

        if ($report->expand) {
            // We're expanding, and for that we need to figure out the
            // calendar's timezone.
            $tzProp = '{'.self::NS_CALDAV.'}calendar-timezone';
            $tzResult = $this->server->getProperties($path, [$tzProp]);
            if (isset($tzResult[$tzProp])) {
                // This property contains a VCALENDAR with a single
                // VTIMEZONE.
                $vtimezoneObj = VObject\Reader::read($tzResult[$tzProp]);
                $calendarTimeZone = $vtimezoneObj->VTIMEZONE->getTimeZone();

                // Destroy circular references so PHP will garbage collect the
                // object.
                $vtimezoneObj->destroy();
            } else {
                // Defaulting to UTC.
                $calendarTimeZone = new DateTimeZone('UTC');
            }
        }

=>

        if ($report->expand) {
            // We're expanding, and for that we need to figure out the
            // calendar's timezone.
            $tzProp = '{'.self::NS_CALDAV.'}calendar-timezone';
            $tzResult = $this->server->getProperties($path, [$tzProp]);
            if (isset($tzResult[$tzProp])) {
                $calendarTimeZone = new DateTimeZone($tzResult[$tzProp]);
            } else {
                // Defaulting to UTC.
                $calendarTimeZone = new DateTimeZone('UTC');
            }
        }

@pegelow
Copy link

pegelow commented Jul 2, 2024

patch
patch.txt

@Tntdruid
Copy link

Tntdruid commented Jul 2, 2024

do a PR for that.

@starsoccer
Copy link

Bump on this. This blocks being able to use Home assistant as previously mentioned

@BramDiepenbrock
Copy link

Bump, I encountered this too. I am looking to switch to Radicale in the meantime.

@starsoccer
Copy link

Bump, I encountered this too. I am looking to switch to Radicale in the meantime.

Any guidance on how to switch? I am tempted too since it seems like this has been a long running issue

@BramDiepenbrock
Copy link

The first step is to get your .ics calendars in order to move them to a different server.

I did a proof of principle with the following docker compose from: https://github.com/tomsquest/docker-radicale/blob/master/docker-compose.yml. Be sure to change the IP address to yours and the place for the volume.

Once it is up and running you can log in with any user name and password since authentication is not enabled yet. I logged in with admin and created a "Default" calendar. Once created you can add the calendar to Mozilla Thunderbird to import the .ics calendar using the url you used to access Radicale. Using that same link you can add the calendar to Home Assistant. So far that seems to work.

At the moment I am trying to figure out how I should go about the user authentication. With a reverse proxy like Caddy, Radicale can be accessed securely.

The url should look like this: https://radicale.example.com/ or when accessed locally: http://192.168.1.53:5232/

Another alternative is using Nextcloud All in One, but that brings a whole suite of different applications with it.

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

7 participants