From c75c48a8a6e54fb8c08649370b5330c912922e5c Mon Sep 17 00:00:00 2001 From: Svante Richter Date: Thu, 16 Feb 2017 20:24:48 +0100 Subject: [PATCH] Bypass hydration to make sure that we don't error in that templatefields trait. --- src/TranslateExtension.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/TranslateExtension.php b/src/TranslateExtension.php index 6f20c36..6a0113a 100644 --- a/src/TranslateExtension.php +++ b/src/TranslateExtension.php @@ -269,9 +269,10 @@ public function getCurrentLocaleStructure() ->where($request->get('_locale') . 'slug = ?') ->setParameter(0, $request->get('slug')) ; - $newSlug = $repo->findOneWith($qb); - if ($newSlug && !empty($newSlug[$locale->getSlug() . 'slug'])) { - $requestAttributes['slug'] = $newSlug[$locale->getSlug() . 'slug']; + $query = $qb->execute(); + $newSlug = $query->fetchAll(); + if ($newSlug && isset($newSlug[0][$locale->getSlug() . 'slug']) && !empty($newSlug[0][$locale->getSlug() . 'slug'])) { + $requestAttributes['slug'] = $newSlug[0][$locale->getSlug() . 'slug']; } else { $requestAttributes['slug'] = $request->get('slug'); }