ENHANCEMENT: Ticket 2756: Newsletter performance problem, run out of memory.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70956 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2009-01-29 05:17:10 +00:00 committed by Sam Minnee
parent 66ce174441
commit 2939e33554

View File

@ -755,8 +755,9 @@ class ComplexTableField_ItemRequest extends RequestHandler {
if(!isset($_REQUEST['ctf']['start']) || !is_numeric($_REQUEST['ctf']['start']) || $_REQUEST['ctf']['start'] == 0) {
return null;
}
$item = $this->unpagedSourceItems->First();
// We never use $item afterwards in the function, where we have it here? disable it!
//$item = $this->unpagedSourceItems->First();
$start = 0;
return Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}");
}
@ -765,8 +766,9 @@ class ComplexTableField_ItemRequest extends RequestHandler {
if(!isset($_REQUEST['ctf']['start']) || !is_numeric($_REQUEST['ctf']['start']) || $_REQUEST['ctf']['start'] == $this->totalCount-1) {
return null;
}
$item = $this->unpagedSourceItems->Last();
// We never use $item afterwards in the function, where we have it here? disable it!
// $item = $this->unpagedSourceItems->Last();
$start = $this->totalCount - 1;
return Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}");
}
@ -776,7 +778,8 @@ class ComplexTableField_ItemRequest extends RequestHandler {
return null;
}
$item = $this->unpagedSourceItems->getIterator()->getOffset($_REQUEST['ctf']['start'] + 1);
// We never use $item afterwards in the function, where we have it here? disable it!
//$item = $this->unpagedSourceItems->getIterator()->getOffset($_REQUEST['ctf']['start'] + 1);
$start = $_REQUEST['ctf']['start'] + 1;
return Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}");
@ -787,7 +790,8 @@ class ComplexTableField_ItemRequest extends RequestHandler {
return null;
}
$item = $this->unpagedSourceItems->getIterator()->getOffset($_REQUEST['ctf']['start'] - 1);
// We never use $item afterwards in the function, where we have it here? disable it!
//$item = $this->unpagedSourceItems->getIterator()->getOffset($_REQUEST['ctf']['start'] - 1);
$start = $_REQUEST['ctf']['start'] - 1;
return Controller::join_links($this->Link(), "$this->methodName?ctf[start]={$start}");