From 40d1276c3669ab568ac20e466a3bd04233a2cf17 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 11 Nov 2014 15:21:45 +0100 Subject: [PATCH] Fixed generating empty difference snapshots --- src/Services/HistoryService.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Services/HistoryService.php b/src/Services/HistoryService.php index 24af14ff..657f6017 100644 --- a/src/Services/HistoryService.php +++ b/src/Services/HistoryService.php @@ -43,11 +43,10 @@ class HistoryService if ($otherSnapshots) { $lastSnapshot = array_shift($otherSnapshots); - if (md5(json_encode($lastSnapshot->getData())) === md5(json_encode($snapshot->getData()))) - return $lastSnapshot; - $dataDifference = $this->getSnapshotDataDifference($snapshot->getData(), $lastSnapshot->getData()); $snapshot->setDataDifference($dataDifference); + if (empty($dataDifference['+']) && empty($dataDifference['-'])) + return $lastSnapshot; } else {