diff --git a/src/Repository/LogEntryRepository.php b/src/Repository/LogEntryRepository.php index 40ff3ec2..38a4d98b 100644 --- a/src/Repository/LogEntryRepository.php +++ b/src/Repository/LogEntryRepository.php @@ -143,8 +143,7 @@ class LogEntryRepository extends DBElementRepository ->andWhere('log.target_type = :target_type') ->andWhere('log.target_id = :target_id') ->andWhere('log.timestamp >= :until') - ->orderBy('log.timestamp', 'DESC') - ->groupBy('log.id'); + ; $qb->setParameter('target_type', LogTargetType::fromElementClass($element)); $qb->setParameter('target_id', $element->getID()); diff --git a/tests/Repository/LogEntryRepositoryTest.php b/tests/Repository/LogEntryRepositoryTest.php index c03c2023..1231ee8b 100644 --- a/tests/Repository/LogEntryRepositoryTest.php +++ b/tests/Repository/LogEntryRepositoryTest.php @@ -114,6 +114,13 @@ class LogEntryRepositoryTest extends KernelTestCase public function testGetElementExistedAtTimestamp(): void { + $part = $this->entityManager->find(Part::class, 3); + + //Assume that the part is existing now + $this->assertTrue($this->repo->getElementExistedAtTimestamp($part, new \DateTimeImmutable())); + + //Assume that the part was not existing long time ago + $this->assertFalse($this->repo->getElementExistedAtTimestamp($part, new \DateTimeImmutable('2000-01-01'))); } public function testGetTimetravelDataForElement(): void