Skip to content

Commit

Permalink
Bypass hydration to make sure that we don't error in that templatefie…
Browse files Browse the repository at this point in the history
…lds trait.
  • Loading branch information
SahAssar authored Feb 16, 2017
1 parent d97b062 commit c75c48a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/TranslateExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit c75c48a

Please sign in to comment.