diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-10-25 22:16:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-25 22:16:08 +0300 |
commit | 8f65ec2ede1476fc544f890136d8ac0975a9aa7f (patch) | |
tree | 0a49a911ffe0e11737a0f172e34d9484102b4465 | |
parent | eaa3315348473d53c1fd72185721d75a57727d85 (diff) | |
parent | 6912ae09cfd8c3083653e222dc3cb043b4ef4834 (diff) |
Merge pull request #4153 from nextcloud/bugfix/4152/fix-duedate-activity
-rw-r--r-- | .github/workflows/integration.yml | 2 | ||||
-rw-r--r-- | lib/Activity/ActivityManager.php | 10 | ||||
-rw-r--r-- | lib/Activity/DeckProvider.php | 13 | ||||
-rwxr-xr-x | tests/integration/run.sh | 3 |
4 files changed, 21 insertions, 7 deletions
diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3eb4aaad..11eed18c 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/lib/Activity/ActivityManager.php b/lib/Activity/ActivityManager.php index 9fc7286f..4a74e2d9 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 4235816e..a2a5c9d8 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; diff --git a/tests/integration/run.sh b/tests/integration/run.sh index 72e1368f..bcabf9ed 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 |