Skip to content

ics import: duplicate UIDs #799

@andreheuer

Description

@andreheuer

I am using the import functionality to import an ICS file from Google Calendar. Now, I was wondering why not all events are being imported, so I debugged into the import function. As per my understanding, the update-function uses the UID of the VEVENT as primary key to identify the event to be updated. However, the UID in the ics file does not have to be unique, but can reference other VEVENTs. As a result, by iterating over the events to be updated (or imported), the same event in Typo3 will be updated even though the VEVENT is in fact a different one.

To test this, I have amended ImportSingleIcalEventListener.php to validate as follows:

        if (null !== $eventObj->getUid() && (int)$eventObj->getUid() > 0) {
            $this->eventRepository->update($eventObj);
            echo("update\n");
        } else {
            $this->eventRepository->add($eventObj);
            echo("added\n");
        }

then deleted all events and triggered the import:

Send ImportSingleIcalEvent for each event
-----------------------------------------

 845/845 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 Dispatched 10 Events
 Skipped 835 Events

Run Reindex process after import
--------------------------------

Übung A
added
Übung B
update
Übung C
update
Übung D
added
Übung E
update
Übung F
added
Übung G
added
Übung H
added
Übung I
added
Übung J
added

As you can see, Übung C and Übung E was updated and not added (as it should be).

Is there any idea how to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions