Skip to content

Commit bd58899

Browse files
luka-nextcloudbackportbot[bot]
authored andcommitted
fix: duedate comparison in activity logging
Signed-off-by: Luka Trovic <luka@nextcloud.com>
1 parent b0d9f40 commit bd58899

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎lib/Activity/ActivityManager.php‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,9 @@ public function triggerUpdateEvents($objectType, ChangeSet $changeSet, $subject)
268268
'before' => $previousEntity->$getter(),
269269
'after' => $entity->$getter()
270270
];
271-
if ($changes['before'] !== $changes['after']) {
272-
if ($field === 'duedate' && $changes['before']->format('c') === $changes['after']->format('c')) {
273-
continue;
274-
}
271+
$beforeValue = $changes['before'] instanceof \DateTimeInterface ? $changes['before']->format('c') : $changes['before'];
272+
$afterValue = $changes['after'] instanceof \DateTimeInterface ? $changes['after']->format('c') : $changes['after'];
273+
if ($beforeValue !== $afterValue) {
275274
try {
276275
$event = $this->createEvent($objectType, $entity, $subjectComplete, $changes, $this->userId);
277276
if ($event !== null) {

0 commit comments

Comments
 (0)