Skip to content

Commit 51854ce

Browse files
author
Kousuke Ebihara
committed
fixed that opAPI::getTotalCount() doesn't return a valid count
1 parent 3139c18 commit 51854ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/api/opAPI.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function getParentObject()
147147
public function setOffsetAndLimitation()
148148
{
149149
$q = clone $this->getQuery();
150-
$this->totalCount = $q->select('COUNT(id)')->execute(array(), Doctrine::HYDRATE_SINGLE_SCALAR);
150+
$this->totalCount = $q->select('COUNT(DISTINCT id)')->execute(array(), Doctrine::HYDRATE_SINGLE_SCALAR);
151151
$this->getQuery()->setHydrationMode(Doctrine::HYDRATE_RECORD);
152152

153153
$this->query->limit($this->getParameter('max-results', 25));

0 commit comments

Comments
 (0)