There is a bug when moving an contact with birthdate to another address book.
I found the cause and described it in https://github.com/nextcloud/server/issues/20492#issuecomment-663207488
The problem is as follows:
- When a vcard changes, “onCardChanged” is called on the BirthdayService, so that the birthdate can be stored in the calendar.
BirthdayService::updateCalendar
checks if the calendar entry already exists withCalDavBackEnd::getCalendarObject($calendarId, $objectUri)
. That one says “no, does not exist”, because the$objectUri
is at the new calendar.BirthdayService::updateCalendar
tries to create a new calendar entry withCalDavBackEnd::createCalendarObject($calendarId, $objectUri, $calendarData->serialize())
. That fails, becausecreateCalendarObject
first checks if an calendar entry with that UID (not uri!) already exists, and throws an exception here.I am not sure what the right solution would be here.
Step 2 could use the UID to check if the calendar entry exists instead of the URI, but that may have side effects I do not know of.
What do the nextcloud devs think how that should be solved?