Skip to content

Commit e586c24

Browse files
authored
Merge pull request #2009 from rcwsr/fix-id-type-query
[Loggable] Adds missing string cast, causing indexes not to be used due to incorrect type
2 parents a579d7e + 61152b0 commit e586c24

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ a release.
1919
---
2020

2121
## [Unreleased]
22+
### Loggable
23+
#### Fixed
24+
- Added missing string casting of `objectId` in `LogEntryRepository::revert()` method (#2009)
2225

2326
## [2.4.37] - 2019-03-17
2427
### Translatable

lib/Gedmo/Loggable/Entity/Repository/LogEntryRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function revert($entity, $version = 1)
8888
$dql .= " AND log.version <= :version";
8989
$dql .= " ORDER BY log.version ASC";
9090

91-
$objectId = $wrapped->getIdentifier();
91+
$objectId = (string) $wrapped->getIdentifier();
9292
$q = $this->_em->createQuery($dql);
9393
$q->setParameters(compact('objectId', 'objectClass', 'version'));
9494
$logs = $q->getResult();

0 commit comments

Comments
 (0)