3070 Posts in 869 Topics by 651 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 806 Views |
-
Search Results > Pagination

8 December 2010 at 4:24am
Hi,
I have a custom search query and results page (NewsroomSearchHolder) that I've had working for a long time and it has broken in my upgrade from 2.3.6 to 2.4.3. Specifically, it seems to be the function parseQueryLimit() in /sapphire/core/model/DataObjectSet.php. I instantiate a DataObjectSet:
$results = new DataObjectSet();
I run my SQLQuery():
$result = $query->execute();
foreach($result as $sqlResult) {
...
}And then call:
$results->parseQueryLimit($query);
When I comment out the parseQueryLimit() call I get all my data back (thought the paging is of course way off); if I leave the parseQueryLimit() in, I get nasty SQL errors (Duplicate column name 'ID'). I can run this exact query directly against the database, though, and get no errors. Can someone shed some light on what exactly this function does, and why, if at all, it is changing my query?
Has anyone else had any problems with this?
Thanks,
Garrett -
Re: Search Results > Pagination

13 December 2010 at 4:52am
Well it says "Use the limit from the given query to add prev/next buttons to this DataObject" on http://api.silverstripe.org/2.4/sapphire/model/DataObjectSet.html
I am sure it will be very obvious if you opened the source and read it - code is often the best documentation.
In order to paginate my results I follow the recipe in the documentation... http://doc.silverstripe.org/private:recipes:pagination
hope this helps
| 806 Views | ||
|
Page:
1
|
Go to Top |


