#19280: Fixing Custom Forms pager

* Fixes the query for get the pager total item count.

Work Item: 19280

--HG--
branch : 1.x
extra : rebase_source : 4761b43545d4d001a67b786cb791e6f14cd3eb58
This commit is contained in:
jorgegamba
2012-11-21 13:52:20 -05:00
parent 4680c32825
commit aaa78faa9f

View File

@@ -136,7 +136,10 @@ namespace Orchard.CustomForms.Controllers {
list.AddRange(submissions);
var totalItemCount = Services.ContentManager
.Query<CommonPart, CommonPartRecord>().Where(x => x.Container == formPart.ContentItem.Record).Count();
.Query<CommonPart, CommonPartRecord>()
.ForVersion(VersionOptions.Latest)
.Where(x => x.Container.Id == id)
.Count();
shape.Pager(Services.New.Pager(pager).TotalItemCount(totalItemCount));
shape.List(list);
return View(shape);