|
@@ -100,6 +100,17 @@ abstract class AbstractTreeRepository extends EntityRepository implements Reposi
|
|
|
}
|
|
|
|
|
|
$qb = $this->getChildrenQueryBuilder($node, $direct);
|
|
|
+
|
|
|
+ // We need to remove the ORDER BY DQL part since some vendors could throw an error
|
|
|
+ // in count queries
|
|
|
+ $dqlParts = $qb->getDQLParts();
|
|
|
+
|
|
|
+ // We need to check first if there's an ORDER BY DQL part, because resetDQLPart doesn't
|
|
|
+ // check if its internal array has an "orderby" index
|
|
|
+ if (isset($dqlParts['orderby'])) {
|
|
|
+ $qb->resetDQLPart('orderby');
|
|
|
+ }
|
|
|
+
|
|
|
$aliases = $qb->getRootAliases();
|
|
|
$alias = $aliases[0];
|
|
|
|