Skip to content

Commit c8f6ebc

Browse files
authored
Merge pull request #2018 from bobdenotter/patch-1
Return `parent` instead of throwing Exception for Translatable
2 parents ebdc41e + 1838662 commit c8f6ebc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ a release.
2323
#### Fixed
2424
- Added missing string casting of `objectId` in `LogEntryRepository::revert()` method (#2009)
2525

26+
### Translatable
27+
#### Fixed
28+
- Return default AST executor instead of throwing Exception in Walker (#2018)
29+
2630
### Tree
2731
#### Fixed
2832
- Remove hard-coded parent column name in repository prev/next sibling queries [#2020]

lib/Gedmo/Translatable/Query/TreeWalker/TranslationWalker.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ public function __construct($query, $parserResult, array $queryComponents)
104104
*/
105105
public function getExecutor($AST)
106106
{
107+
// If it's not a Select, the TreeWalker ought to skip it, and just return the parent.
108+
// @see https://github.com/Atlantic18/DoctrineExtensions/issues/2013
107109
if (!$AST instanceof SelectStatement) {
108-
throw new \Gedmo\Exception\UnexpectedValueException('Translation walker should be used only on select statement');
110+
return parent::getExecutor($AST);
109111
}
110112
$this->prepareTranslatedComponents();
111113

0 commit comments

Comments
 (0)