From f28374c8341b34dc4c096cb480b8d1dd48bf57a3 Mon Sep 17 00:00:00 2001 From: Milan Mertens Date: Tue, 18 Feb 2025 13:17:09 +0100 Subject: [PATCH 1/2] ci(docker build) fix tika checksum check --- ci/dockerimage/base.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dockerimage/base.Dockerfile b/ci/dockerimage/base.Dockerfile index a8a9341c4b..beb72aa0c7 100644 --- a/ci/dockerimage/base.Dockerfile +++ b/ci/dockerimage/base.Dockerfile @@ -71,7 +71,7 @@ RUN apk add --update --no-cache supervisor curl bash ytnef openjdk8-jre gettext # install latest version of tika 2.9.*. (Expects apache to only serve on version of tika 2.9.*) RUN tika_version=$(curl https://dlcdn.apache.org/tika/ | grep -oh '' | cut -d '"' -f 2 | cut -d / -f 1) \ && curl https://dlcdn.apache.org/tika/${tika_version}/tika-app-${tika_version}.jar --output /usr/local/bin/tika.jar \ - && echo $(curl https://dlcdn.apache.org/tika/${tika_version}/tika-app-${tika_version}.jar.sha512) /usr/local/bin/tika.jar | sha512sum -c + && echo "$(curl https://dlcdn.apache.org/tika/${tika_version}/tika-app-${tika_version}.jar.sha512) /usr/local/bin/tika.jar" | sha512sum -c RUN apk add --no-cache \ ${ALPINE_PHP_PACKAGE} \ From 675d086e24e4f3ab6cfe375482ea4f3c2fe3758b Mon Sep 17 00:00:00 2001 From: Stefanie Stamer Date: Mon, 24 Feb 2025 12:15:06 +0000 Subject: [PATCH 2/2] fix(Calendar): resolving rrule events is missing base event for tags --- tine20/Calendar/Convert/Event/Json.php | 5 +++-- tine20/Calendar/Model/Rrule.php | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tine20/Calendar/Convert/Event/Json.php b/tine20/Calendar/Convert/Event/Json.php index 165a9fa695..1ff36b2154 100644 --- a/tine20/Calendar/Convert/Event/Json.php +++ b/tine20/Calendar/Convert/Event/Json.php @@ -199,7 +199,8 @@ public function fromTine20RecordSet(Tinebase_Record_RecordSet $_records = NULL, Calendar_Controller_Event::getInstance()->getAlarms($_records); Calendar_Convert_Event_Json::resolveGrantsOfExternalOrganizers($_records); - Calendar_Model_Rrule::mergeAndRemoveNonMatchingRecurrences($_records, $_filter); + $removedEvents = Calendar_Model_Rrule::mergeAndRemoveNonMatchingRecurrences($_records, $_filter); + $removedResults = parent::fromTine20RecordSet($removedEvents, $_filter, $_pagination); $_records->sortByPagination($_pagination); @@ -207,7 +208,7 @@ public function fromTine20RecordSet(Tinebase_Record_RecordSet $_records = NULL, // NOTE: parent::fromTine20RecordSet does not expand values in recurring instances (tags, notes, attachments, (system) cf's // therefore we copy anything not scheduling related manualy here (NOTE freebusy infos have no id) - $baseEventMap = array_reduce($results, function ($map, $result) { + $baseEventMap = array_reduce(array_merge($results, $removedResults), function ($map, $result) { if (isset($result['id']) && !preg_match('/^fakeid/', $result['id'])) { $map[$result['id']] = $result; } diff --git a/tine20/Calendar/Model/Rrule.php b/tine20/Calendar/Model/Rrule.php index 7e1a9fe23c..ed5e4a26ff 100644 --- a/tine20/Calendar/Model/Rrule.php +++ b/tine20/Calendar/Model/Rrule.php @@ -562,33 +562,38 @@ protected static function addRecurrence($_recurrence, $_eventSet) $_eventSet->addRecord($_recurrence); } - + /** * merge recurrences amd remove all events that do not match period filter - * + * * @param Tinebase_Record_RecordSet $_events * @param Calendar_Model_EventFilter $_filter + * @return Tinebase_Record_RecordSet $removedEvents */ public static function mergeAndRemoveNonMatchingRecurrences(Tinebase_Record_RecordSet $_events, Calendar_Model_EventFilter $_filter = null) { + $removedEvents = new Tinebase_Record_RecordSet(Calendar_Model_Event::class); if (!$_filter) { - return; + return $removedEvents; } - + $period = $_filter->getFilter('period', false, true); if ($period) { self::mergeRecurrenceSet($_events, $period->getFrom(), $period->getUntil()); - + foreach ($_events as $event) { if (! $event->isInPeriod($period)) { - if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . ' (' . __LINE__ + if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . ' (' . __LINE__ . ') Removing not matching event ' . $event->summary); + $removedEvents->addRecord($event); $_events->removeRecord($event); } } } + return $removedEvents; } - + + /** * returns next occurrence _ignoring exceptions_ or NULL if there is none/not computable *