mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-23 17:41:01 +00:00
Fix hazardous bug with Postgres
Instead of retrieving a random annotation, sort them to be sure they are all the same no matter the database used
This commit is contained in:
parent
09d8bb6fa2
commit
b95ffda2a1
2 changed files with 2 additions and 1 deletions
|
@ -101,6 +101,7 @@ class AnnotationRepository extends EntityRepository
|
|||
return $this->createQueryBuilder('a')
|
||||
->leftJoin('a.user', 'u')
|
||||
->where('u.username = :username')->setParameter('username', $username)
|
||||
->orderBy('a.id', 'DESC')
|
||||
->setMaxResults(1)
|
||||
->getQuery()
|
||||
->getSingleResult();
|
||||
|
|
|
@ -81,7 +81,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
|||
$this->assertEquals('Big boss', $content['user']);
|
||||
$this->assertEquals('v1.0', $content['annotator_schema_version']);
|
||||
$this->assertEquals('a modified annotation', $content['text']);
|
||||
$this->assertEquals('content', $content['quote']);
|
||||
$this->assertEquals('my quote', $content['quote']);
|
||||
|
||||
$annotationUpdated = $this->client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
|
|
Loading…
Reference in a new issue