diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a2f2537a..fb6eb8ed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to ## Unreleased - +* [person search] fix bug when using birthdate after and birthdate before ## Test releases diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php index b55e69655..d80a8f7d5 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -180,14 +180,14 @@ final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterfac if (null !== $birthdateBefore) { $query->andWhereClause( - 'p.birthdate < ?::date', + 'person.birthdate <= ?::date', [$birthdateBefore->format('Y-m-d')] ); } if (null !== $birthdateAfter) { $query->andWhereClause( - 'p.birthdate > ?::date', + 'person.birthdate >= ?::date', [$birthdateAfter->format('Y-m-d')] ); }