From 5669bd73cc6d735984c1afac1ab189f21bbfc082 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 24 Oct 2022 12:31:38 +0200 Subject: [PATCH 1/2] Fix Duedate activity Signed-off-by: Joas Schilling --- lib/Activity/ActivityManager.php | 10 +++++++++- lib/Activity/DeckProvider.php | 13 ++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php index 9fc7286fa..4a74e2d9d 100644 --- a/lib/Activity/ActivityManager.php +++ b/lib/Activity/ActivityManager.php @@ -367,7 +367,15 @@ class ActivityManager { case self::SUBJECT_CARD_USER_ASSIGN: case self::SUBJECT_CARD_USER_UNASSIGN: $subjectParams = $this->findDetailsForCard($entity->getId(), $subject); - break; + + if (isset($additionalParams['after']) && $additionalParams['after'] instanceof \DateTimeInterface) { + $additionalParams['after'] = $additionalParams['after']->format('c'); + } + if (isset($additionalParams['before']) && $additionalParams['before'] instanceof \DateTimeInterface) { + $additionalParams['before'] = $additionalParams['before']->format('c'); + } + + break; case self::SUBJECT_ATTACHMENT_CREATE: case self::SUBJECT_ATTACHMENT_UPDATE: case self::SUBJECT_ATTACHMENT_DELETE: diff --git a/lib/Activity/DeckProvider.php b/lib/Activity/DeckProvider.php index 4235816e5..a2a5c9d8c 100644 --- a/lib/Activity/DeckProvider.php +++ b/lib/Activity/DeckProvider.php @@ -312,12 +312,19 @@ class DeckProvider implements IProvider { $userLanguage = $this->config->getUserValue($event->getAuthor(), 'core', 'lang', $this->l10nFactory->findLanguage()); $userLocale = $this->config->getUserValue($event->getAuthor(), 'core', 'locale', $this->l10nFactory->findLocale()); $l10n = $this->l10nFactory->get('deck', $userLanguage, $userLocale); - $date = new \DateTime($subjectParams['after']); - $date->setTimezone(new \DateTimeZone(\date_default_timezone_get())); + if (is_array($subjectParams['after'])) { + // Unluckily there was a time when we stored jsonSerialized date objects in the database + // Broken in 1.8.0 and fixed again in 1.8.1 + $date = new \DateTime($subjectParams['after']['date']); + $date->setTimezone(new \DateTimeZone(\date_default_timezone_get())); + } else { + $date = new \DateTime($subjectParams['after']); + $date->setTimezone(new \DateTimeZone(\date_default_timezone_get())); + } $params['after'] = [ 'type' => 'highlight', 'id' => 'dt:' . $subjectParams['after'], - 'name' => $l10n->l('datetime', $date) + 'name' => $l10n->l('datetime', $date), ]; } return $params; From 6912ae09cfd8c3083653e222dc3cb043b4ef4834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 25 Oct 2022 20:57:16 +0200 Subject: [PATCH 2/2] Fix integration test run script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .github/workflows/integration.yml | 2 +- tests/integration/run.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3eb4aaad3..11eed18c9 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -79,7 +79,7 @@ jobs: - name: Set up PHPUnit working-directory: apps/${{ env.APP_NAME }} - run: composer i + run: composer i --no-dev - name: Set up Nextcloud run: | diff --git a/tests/integration/run.sh b/tests/integration/run.sh index 72e1368f1..bcabf9ed7 100755 --- a/tests/integration/run.sh +++ b/tests/integration/run.sh @@ -19,8 +19,7 @@ else exit 1 fi -composer install --no-dev -composer dump-autoload +composer install # avoid port collision on jenkins - use $EXECUTOR_NUMBER if [ -z "$EXECUTOR_NUMBER" ]; then