mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#5426 Projections don't order queries following Position field
Projections don't order queries following the Position field of each order in the query Related issue https://github.com/OrchardCMS/Orchard/issues/5426
This commit is contained in:
@@ -147,7 +147,7 @@ namespace Orchard.Projections.Services {
|
||||
var groupQuery = _contentManager.HqlQuery().Where(alias => alias.Named("ci"), x => x.InG("Id", ids));
|
||||
|
||||
// iterate over each sort criteria to apply the alterations to the query object
|
||||
foreach (var sortCriterion in queryRecord.SortCriteria) {
|
||||
foreach (var sortCriterion in queryRecord.SortCriteria.OrderBy(s => s.Position)) {
|
||||
var sortCriterionContext = new SortCriterionContext {
|
||||
Query = groupQuery,
|
||||
State = FormParametersHelper.ToDynamic(sortCriterion.State)
|
||||
@@ -210,7 +210,7 @@ namespace Orchard.Projections.Services {
|
||||
}
|
||||
|
||||
// iterate over each sort criteria to apply the alterations to the query object
|
||||
foreach (var sortCriterion in sortCriteria) {
|
||||
foreach (var sortCriterion in sortCriteria.OrderBy(s => s.Position)) {
|
||||
var sortCriterionContext = new SortCriterionContext {
|
||||
Query = contentQuery,
|
||||
State = FormParametersHelper.ToDynamic(sortCriterion.State)
|
||||
@@ -240,4 +240,4 @@ namespace Orchard.Projections.Services {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user