From ffdd7427672514ece699a6718e609094f053b476 Mon Sep 17 00:00:00 2001 From: Denis Gorin Date: Tue, 29 Sep 2020 12:06:59 +0700 Subject: [PATCH] fix displaying page (singleton) by slug --- src/Repository/ContentRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Repository/ContentRepository.php b/src/Repository/ContentRepository.php index ad5644d3a..5c1f51a34 100644 --- a/src/Repository/ContentRepository.php +++ b/src/Repository/ContentRepository.php @@ -128,8 +128,12 @@ public function findOneById(int $id): ?Content return $this->find($id); } - public function findOneBySlug(string $slug, ?ContentType $contentType = null): ?Content + /* + * @param string|int $slug + */ + public function findOneBySlug($slug, ?ContentType $contentType = null): ?Content { + $slug = (string) $slug; $qb = $this->getQueryBuilder(); $connection = $qb->getEntityManager()->getConnection();