events2 icon indicating copy to clipboard operation
events2 copied to clipboard

PostProcessICalRowsForICalDownloadEvent

Open Mordef opened this issue 4 months ago • 0 comments

The Event PostProcessICalRowsForICalDownloadEvent is not usable in Version 9.0.8

        $this->eventDispatcher->dispatch(
            new PostProcessICalRowsForICalDownloadEvent($iCalRowsForAnEvent, $day),
        );

        array_push($iCal, ...$iCalRowsForAnEvent);

When change the Eventsdata, the return value is not used.

        $postProcessEvent = $this->eventDispatcher->dispatch(
            new PostProcessICalRowsForICalDownloadEvent($iCalRowsForAnEvent, $day),
        );

        array_push($iCal, ...$postProcessEvent->getEvent());

Fixed this.

Patch:

diff --git a/vendor/jweiland/events2/Classes/Helper/ICalendarHelper.php b/vendor/jweiland/events2/Classes/Helper/ICalendarHelper.php
--- a/vendor/jweiland/events2/Classes/Helper/ICalendarHelper.php
+++ b/vendor/jweiland/events2/Classes/Helper/ICalendarHelper.php
@@ -90,11 +90,11 @@ class ICalendarHelper
         $this->addEventDescription($iCalRowsForAnEvent, $day);
         $this->addEventEnd($iCalRowsForAnEvent);

-        $this->eventDispatcher->dispatch(
+        $postProcessEvent = $this->eventDispatcher->dispatch(
             new PostProcessICalRowsForICalDownloadEvent($iCalRowsForAnEvent, $day),
         );

-        array_push($iCal, ...$iCalRowsForAnEvent);
+        array_push($iCal, ...$postProcessEvent->getEvent());
     }

     protected function addEventBegin(array &$event): void

Mordef avatar Oct 07 '24 08:10 Mordef