[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [FIX] duplicate event when changing event calendar and save
"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a14374cefbc4_37127e045c318de@gitlab-sidekiq-low-urgency-cpu-bound-v2-d7f87744c-rzw6b.mail> |
Victor Emanouilov pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki
Commits:
0a397370 by Victor Emanouilov at 2026-05-25T14:49:27+03:00
[FIX] duplicate event when changing event calendar and save
- - - - -
1 changed file:
- lib/core/Tiki/SabreDav/CalDAVBackend.php
Changes:
=====================================
lib/core/Tiki/SabreDav/CalDAVBackend.php
=====================================
@@ -589,6 +589,18 @@ class CalDAVBackend extends CalDAV\Backend\AbstractBackend implements
if (! is_array($calendarId)) {
throw new \InvalidArgumentException('The value passed to $calendarId is expected to be an array with a calendarId and an instanceId');
}
+
+ // changing calendars makes caldav server not able to find the event, so it
+ // tries to recreate it (thus duplicate). Detect this here and force update.
+ try {
+ $existing = $this->mapCalendarObjectUriToItem($objectUri);
+ if ($existing) {
+ return $this->updateCalendarObject($calendarId, $objectUri, $calendarData);
+ }
+ } catch (DAV\Exception\NotFound $e) {
+ // URI doesn't map to any existing item => proceed with creation
+ }
+
list($calendarId, $instanceId) = $calendarId;
$this->ensureCalendarAccess($calendarId, $instanceId, null, 'add_events', 'write');
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0a397370e43c84f27ab515b1999fd8b8153f972f
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0a397370e43c84f27ab515b1999fd8b8153f972f
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs