Skip to content

Commit

Permalink
Changed HistoryLogger::log to skip history log if it is an update wit…
Browse files Browse the repository at this point in the history
…hout data

(ex: diff detected in EntityChangeSet but the targetted fields are actually skip from getHistoryDiffFieldsToSkip)
  • Loading branch information
mathieu-ducrot committed Aug 28, 2024
1 parent 8976624 commit 4d9c112
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Logger/HistoryLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ public function log(HistorizableInterface $entity, ?string $code = null, array $
}
}

// If the history log is an update but without data we don't log it to the database.
if (
$code === self::UPDATED_CODE
&& !isset($history[self::DIFF_PROPERTY])
&& $this->title === null
&& $this->comment === null
&& $this->description === null
) {
return;
}
$entity->addHistory($history);

if ($this->flushLog) {
Expand Down

0 comments on commit 4d9c112

Please sign in to comment.