From e75553aa44c2e24dd98416ec9f404bb51f8bb0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sjo=CC=88berg?= Date: Thu, 27 Nov 2014 13:54:13 +0100 Subject: [PATCH] Fixed type casting in revert function Type casted version to integer for searching out a revision to revert back to --- lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php b/lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php index 3c94e7258b..34741d39c8 100644 --- a/lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php +++ b/lib/Gedmo/Loggable/Document/Repository/LogEntryRepository.php @@ -69,7 +69,7 @@ public function revert($document, $version = 1) $qb = $this->createQueryBuilder(); $qb->field('objectId')->equals($objectId); $qb->field('objectClass')->equals($objectMeta->name); - $qb->field('version')->lte($version); + $qb->field('version')->lte(intval($version)); $qb->sort('version', 'ASC'); $q = $qb->getQuery(); @@ -131,4 +131,4 @@ private function getLoggableListener() } return $this->listener; } -} \ No newline at end of file +}