1

Closed

Projection pager doesn't take Offset value into account

description

Projection pager doesn't take Offset value into account.
For example if there are total of 20 results for a query and offset is set to 10, the pager control will still create paging for 20 items
  • In ProjectionPartDriver.cs:
// create pager shape
if (part.Record.DisplayPager) {
     var contentItemsCount = _projectionManager.GetCount(query.Id);
     pagerShape.TotalItemCount(contentItemsCount);
}

//should be something like:
if (part.Record.DisplayPager) {
     var contentItemsCount = _projectionManager.GetCount(query.Id) - part.Record.Skip;
     pagerShape.TotalItemCount(contentItemsCount);
}

//taking possible negative value into account:
 var contentItemsCount = _projectionManager.GetCount(query.Id) <= part.Record.Skip ? 0 : _projectionManager.GetCount(query.Id) - part.Record.Skip;
Closed Mar 18, 2013 at 10:03 AM by RichardGarside
Closed because not for this project.

comments

RichardGarside wrote Mar 18, 2013 at 10:03 AM

This is not the correct place to report this issue.

This is the issue list just for my Orchard Contact module. You should look at the main Orchard Project.

Mirza wrote Mar 18, 2013 at 10:23 AM

Sorry you are correct,
reposted to:
http://orchard.codeplex.com/workitem/19525

RichardGarside wrote Mar 18, 2013 at 11:23 AM

No worries.

Easy to get mixed up.