[TYPO3-english] widget.paginate works not as expected
Christian Tauscher
christian.tauscher at media-distillery.de
Thu Feb 13 16:16:27 CET 2020
Hello!
In my extention-Template I use
<f:widget.paginate objects="{images}" as="paginatedImages">
...
in my controller:
$images = $this->myRepository->getAll();
...assign to images....
so the widget renders as Expected, mutliple pages.
10 Images per Page, page numbers as expected.
if I change to this:
Controller:
$images = $this->myRepository->findByCategories("1,2,5");
public function findByCategories($categories) {
$query = $this->createQuery();
$result = $query->statement(
'SELECT * FROM
sys_category, sys_category_record_mm, tx_my_domain_model_image
WHERE sys_category.uid = sys_category_record_mm.uid_local
AND tx_art_domain_model_image.uid =
sys_category_record_mm.uid_foreign
AND tablenames = "tx_my_domain_model_image"
AND sys_category.uid in ('.$categories.')'
);
return $query->execute();
}
The records are OK (Only of the selected categories), but the
widget.paginate fails:
Only ONE page is rendered with all the results. The pages(-Browser) are
redered right if I assume the default items pP is 10.
Maybe a different Object type is returned:
I compared the <f:debug>{images.0}</f:debug> of the the two variants:
The returned array of the images are identical.
But somehow/where the countAll() Result is getting lost.
Any help in this issue is welcome!
Thank you in advance,
Christian.
More information about the TYPO3-english
mailing list