demo icon indicating copy to clipboard operation
demo copied to clipboard

Paginator.php

Open lxregistry opened this issue 4 years ago • 2 comments

    // $useOutputWalkers = \count($this->queryBuilder->getDQLPart('having') ?: []) > 0;
    $useOutputWalkers = $this->queryBuilder->getDQLPart('having') != null;

lxregistry avatar Oct 06 '20 12:10 lxregistry

Please, share some details about why this is better. Does it fix a bug? Is it more performant? Thanks.

javiereguiluz avatar Oct 07 '20 15:10 javiereguiluz

this fix a bug, this result -> $this->queryBuilder->getDQLPart('having') is not an array, is a doctrine expression.

also I think this -> $paginator = new DoctrinePaginator($query, true); always true is not ok, I modified like this

    $fetchJoinCollection = true;
    if (0 === \count($this->queryBuilder->getDQLPart('join'))) {
        $query->setHint(CountWalker::HINT_DISTINCT, false);
        $fetchJoinCollection = false;
    }

    $paginator = new DoctrinePaginator($query, $fetchJoinCollection);

    // $useOutputWalkers = \count($this->queryBuilder->getDQLPart('having') ?: []) > 0;
    $useOutputWalkers = $this->queryBuilder->getDQLPart('having') != null;
    $paginator->setUseOutputWalkers($useOutputWalkers); 

lxregistry avatar Oct 08 '20 07:10 lxregistry

Current pagination seems to be working fine and we haven't received any issue reporting problems with it. So, let's close this issue for now and if there are ny issues in the future, we'll receive feedback from people and we'll fix it. Thanks!

javiereguiluz avatar Apr 17 '23 08:04 javiereguiluz