Cast column when comparing comment object_id with the card id
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
backportbot[bot]
parent
28cd9fcf77
commit
24d9b55bfc
@@ -321,7 +321,7 @@ class CardMapper extends QBMapper implements IPermissionMapper {
|
|||||||
$this->extendQueryByFilter($qb, $query);
|
$this->extendQueryByFilter($qb, $query);
|
||||||
|
|
||||||
$qb->innerJoin('c', 'comments', 'comments', $qb->expr()->andX(
|
$qb->innerJoin('c', 'comments', 'comments', $qb->expr()->andX(
|
||||||
$qb->expr()->eq('comments.object_id', 'c.id', IQueryBuilder::PARAM_STR),
|
$qb->expr()->eq('comments.object_id', $qb->expr()->castColumn('c.id', IQueryBuilder::PARAM_STR)),
|
||||||
$qb->expr()->eq('comments.object_type', $qb->createNamedParameter(Application::COMMENT_ENTITY_TYPE, IQueryBuilder::PARAM_STR))
|
$qb->expr()->eq('comments.object_type', $qb->createNamedParameter(Application::COMMENT_ENTITY_TYPE, IQueryBuilder::PARAM_STR))
|
||||||
));
|
));
|
||||||
$qb->selectAlias('comments.id', 'comment_id');
|
$qb->selectAlias('comments.id', 'comment_id');
|
||||||
@@ -339,7 +339,7 @@ class CardMapper extends QBMapper implements IPermissionMapper {
|
|||||||
$tokenMatching
|
$tokenMatching
|
||||||
);
|
);
|
||||||
|
|
||||||
$qb->groupBy('comments.id');
|
$qb->groupBy('comments.id', 'c.id');
|
||||||
$qb->orderBy('comments.id', 'DESC');
|
$qb->orderBy('comments.id', 'DESC');
|
||||||
if ($limit !== null) {
|
if ($limit !== null) {
|
||||||
$qb->setMaxResults($limit);
|
$qb->setMaxResults($limit);
|
||||||
|
|||||||
Reference in New Issue
Block a user