symfony version 1.2.8 (/usr/share/pear/symfony)

Below is my query. The pager produces incorrect pagination results.
The data isn't all that important. What is important the pager
produces the wrong offset when it is not being sorted by ID. The
second page will contain elements from the first page. This causes
some elements to not be listed in the results. There were "missing"
services that were in the database but you couldn't get to in the
admin.

Page 1 would stop at the 20th service listed and page 2 would begin at
the 18th service listed from page 1 but still show 20 results for the
page so a few services weren't displayed.

Adding the sort by ID seemed to fix the problem.

        $c = new Criteria();
                $crit0 = $c->getNewCriterion(CompanyServicePeer::PARENT,
0,Criteria::NOT_EQUAL);
                $crit1 = $c->getNewCriterion
(CompanyServicePeer::PARENT,NULL,Criteria::ISNOTNULL);
                $crit1->addAnd($crit0);
        $c->add($crit1);
        $c->addAscendingOrderByColumn(CompanyServicePeer::ID);
    $pager = new sfPropelPager('CompanyService', 20);
    $pager->setCriteria($c);
    $pager->setPage($this->getRequestParameter('page', 1));
    $pager->init();
    $this->pager = $pager;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to