Following this guide: SearchContext Guide, I built a custom search with pagination, but if i reload result page (by pressing f5) or change page (by pagination links) i get an unformatted page with the following message:
Sorry, your session has timed out.
If if could serve after I change getResults method from tutorial into(changed lines of code in red):
public function getResults($searchCriteria = array()) {
$start = ($this->request->getVar('start')) ? (int)$this->request->getVar('start') : 0;
$limit = 1;
$context = singleton('myObj')->getCustomSearchContext();
$records = $context->getResults($searchCriteria, null, array('start'=>$start,'limit'=>$limit));
$allrecords = $context->getResults($searchCriteria);
if($records) {
$records = new PaginatedList($records, $this->request);
$records->setPageStart($start);
$records->setPageLength($limit);
$records->setTotalItems(count($allrecords));
}
return $records;
}
What's wrong?
Thanks in advance for help.