From ed637e51b9657114e34dc54a999d2278be6ef572 Mon Sep 17 00:00:00 2001 From: neoglez Date: Mon, 21 Sep 2015 08:58:30 +0200 Subject: [PATCH] Backport of "fix aliasing of property in OrderBy from MappedSuperclass" Backport of "LimitSubqueryOutputWalker: fix aliasing of property in OrderBy from MappedSuperclass" ( https://github.com/doctrine/doctrine2/commit/e501137d1afff2c08963828b61b0b8b6668edd83 ) See my comment on https://github.com/neoglez/doctrine2/commit/a3ece3b419fa7bfe50ccf2a48d83545aa007fbe8 --- .../ORM/Tools/Pagination/LimitSubqueryOutputWalker.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php index 22d0628ba..b1d7bd9eb 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php +++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php @@ -438,7 +438,10 @@ class LimitSubqueryOutputWalker extends SqlWalker // Field was declared in a parent class, so we need to get the proper SQL table alias // for the joined parent table. $otherClassMetadata = $this->em->getClassMetadata($fieldMapping['declared']); - $sqlTableAliasForFieldAlias = $this->getSQLTableAlias($otherClassMetadata->getTableName(), $dqlAliasForFieldAlias); + if (!$otherClassMetadata->isMappedSuperclass) { + $sqlTableAliasForFieldAlias = $this->getSQLTableAlias($otherClassMetadata->getTableName(), $dqlAliasForFieldAlias); + + } } // Compose search/replace patterns