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

[stable27] fix(caldav): loop through all events for busy events #45311

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions apps/dav/lib/CalDAV/CalendarObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,16 @@ protected function isShared() {
* @param Component\VCalendar $vObject
* @return void
*/
private function createConfidentialObject(Component\VCalendar $vObject) {
private function createConfidentialObject(Component\VCalendar $vObject): void {
/** @var Component $vElement */
$vElement = null;
if (isset($vObject->VEVENT)) {
$vElement = $vObject->VEVENT;
}
if (isset($vObject->VJOURNAL)) {
$vElement = $vObject->VJOURNAL;
}
if (isset($vObject->VTODO)) {
$vElement = $vObject->VTODO;
}
if (!is_null($vElement)) {
$vElements = array_filter($vObject->getComponents(), static function ($vElement) {
return $vElement instanceof Component\VEvent || $vElement instanceof Component\VJournal || $vElement instanceof Component\VTodo;
});

foreach ($vElements as $vElement) {
if (empty($vElement->select('SUMMARY'))) {
$vElement->add('SUMMARY', $this->l10n->t('Busy')); // This is needed to mask "Untitled Event" events
}
foreach ($vElement->children() as &$property) {
/** @var Property $property */
switch ($property->name) {
Expand Down
Loading