From d606187ab7f9d739f07ae702f81f04e6c1ef9c23 Mon Sep 17 00:00:00 2001 From: Ruud Arentsen Date: Thu, 26 Jul 2012 09:12:05 +0200 Subject: [PATCH 1/2] fixed the issue that the form wouldn't submit fixed the issue that the form wouldn't submit on require_login = true. E-mail field needed to be hidden as well. --- code/controllers/CommentingController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/code/controllers/CommentingController.php b/code/controllers/CommentingController.php index c042c60..32bbdeb 100644 --- a/code/controllers/CommentingController.php +++ b/code/controllers/CommentingController.php @@ -274,6 +274,7 @@ class CommentingController extends Controller { $fields->removeByName('Email'); $fields->insertBefore(new ReadonlyField("NameView", _t('CommentInterface.YOURNAME', 'Your name'), $member->getName()), 'URL'); $fields->push(new HiddenField("Name", "", $member->getName())); + $fields->push(new HiddenField("Email", "", $member->Email)); $form->setFields($fields); } From 9e96d43e04511eb77dd530fd4c65915bc5224dab Mon Sep 17 00:00:00 2001 From: Ruud Arentsen Date: Thu, 26 Jul 2012 09:40:57 +0200 Subject: [PATCH 2/2] 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; }