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 · 7 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.

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

5 participants