TYPO3 6.2 fluid pagination not working as expected -


my typo3 6.2 (upgraded typo3 4.5) fluid paginate displays items instead of 5 items.

my repository method :

public function getrandomlocation($ilimit) {     $query = $this->createquery();     $result = $query->statement("select *      tx_sfel_domain_model_ttblocationsproduktegruppen hidden = 0 , deleted = 0 , logo != '' order uid limit 0, ".$ilimit." ");     return $result->execute();  } 

my controller code :

$asresultslocations = $this->ttblocationsproduktegruppenrepository->getrandomlocation($ilimit); $this->view->assign('asresultslocations', $asresultslocations); 

my template :

    <f:widget.paginate objects="{asresultslocations}" as="asresultslocationss" configuration="{itemsperpage: 5, insertabove: 1 insertbelow: 1}">                   <f:for each="{asresultslocationss}" as="asresultslocation">                      .................                       //getting items instead of 5 items.                  </f:for>     </f:widget.paginate>  

in typo3\cms\fluid\viewhelpers\widget\controller\paginatecontroller.php indexaction() i'm getting following results.

code :

$itemsperpage = (int)$this->configuration['itemsperpage'];  $query = $this->objects->getquery(); $query->setlimit($itemsperpage); if ($this->currentpage > 1) {      $query->setoffset((int)($itemsperpage * ($this->currentpage - 1))); } $modifiedobjects = $query->execute(); 

values got here :

$itemsperpage : 5

$query : select * tx_sfel_domain_model_ttblocationsproduktegruppen hidden = 0 , deleted = 0 , (jahr = '13' or jahr = '14' or jahr = '15') , logo != '' order uid limit 0, 26 

$modifiedobjects count = 26

but need '$modifiedobjects count' 5.

i think following not working query object,

$query->setlimit($itemsperpage); $query->setoffset((int)($itemsperpage * ($this->currentpage - 1))); 

i think issue related query object using in paginate. how create query object typo3 6.2 fluid paginate??

please me.

to fix above issue rebuilt query in extbase query format. in typo3 6.2.x paginate not work query statement need convert extbase query format.

my rebuilt query format is,

$constraints = array();  $subconstraints = array();  $query = $this->createquery();   foreach($publicationyears $year)       $subconstraints[] = $query->equals('jahr', $year);   $constraints[] = $query->logicalor($subconstraints);   $constraints[] = $query->logicalnot( $query->equals('logo', '') );   $query->matching($query->logicaland($constraints));   $query->setlimit((integer)$ilimit);   $result = $query->execute(); 

Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -