From 9e96d43e04511eb77dd530fd4c65915bc5224dab Mon Sep 17 00:00:00 2001 From: Ruud Arentsen Date: Thu, 26 Jul 2012 09:40:57 +0200 Subject: [PATCH] fixed pagination for me, pagination worked when i added this code. somehow, the list didn't get the getvar and always remained on the first page. The $list->MoreThanOnePage() fixes an issue where the links didn't appear in the template. --- code/extensions/CommentsExtension.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/extensions/CommentsExtension.php b/code/extensions/CommentsExtension.php index 6208e75..4512637 100644 --- a/code/extensions/CommentsExtension.php +++ b/code/extensions/CommentsExtension.php @@ -75,7 +75,10 @@ class CommentsExtension extends DataExtension { $this->ownerBaseClass, 'comments_per_page' )); + $controller = Controller::curr(); + $list->setPageStart($controller->request->getVar("commentsstart". $this->owner->ID)); $list->setPaginationGetVar("commentsstart". $this->owner->ID); + $list->MoreThanOnePage(); return $list; }