Skip to content

Paginate data when data was retrieved by the "select" method #257

maxailloud opened this Issue Jan 13, 2012 · 4 comments

2 participants


My code:

$datasPager = Model\IdentiteQuery::create()
  ->select(array('Ipp', 'NomNaissance', 'Prenom', 'DateNaissance', 'CreatedAt', 'UpdatedAt'))
  ->orderBy('UpdatedAt', \Criteria::DESC)
  ->paginate($page, 20)

And what I get:

An exception has been thrown during the rendering of a template ("Notice: Undefined offset: 6 in 
/home/mailloud/workspace/referentiels/src/Pmsipilot/ReferentielsBundle/Model/om/BaseIdentite.php line 1250") in
ReferentielsBundle:Data:data.html.twig at line 21.

Using the method "select" with the "paginate" one cause that exception.
It used to work and I don't know when it started to misfunction.

Propel member

Works for me. Could you provide a unit test that shows the bug using the Propel fixtures?

@fzaninotto fzaninotto added a commit to fzaninotto/Propel that referenced this issue Feb 13, 2012
@fzaninotto fzaninotto Add unit tests for paginate() used together with select()
Refs #257.
Propel member

No exception in the unit test I posted.

@fzaninotto fzaninotto closed this Feb 13, 2012

I didn't remember the case, I should have note it, so I think we can easily declared that it's working.

I just remember that it was with the PropelBundle, but maybe I made a mistake at the time.
Too old for me for giving you much details.

Propel member

Ok, then I leave the issue closed since the unit tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.