Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Search Results > Pagination

Go to End

2 Posts   1294 Views


Community Member, 245 Posts

8 December 2010 at 4:24am


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:


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?



Forum Moderator, 1899 Posts

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

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...

hope this helps