mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-24 08:46:48 +08:00
tokens sort criteria (#8382)
* Tokenized state for sort criteria * Tokenized state also in the other place where sort criteria are used
This commit is contained in:
committed by
GitHub
parent
f0c5b62b20
commit
2bc7079593
@@ -166,10 +166,12 @@ namespace Orchard.Projections.Services {
|
||||
|
||||
// iterate over each sort criteria to apply the alterations to the query object
|
||||
foreach (var sortCriterion in queryRecord.SortCriteria.OrderBy(s => s.Position)) {
|
||||
var tokenizedState = _tokenizer.Replace(sortCriterion.State, tokens);
|
||||
var sortCriterionContext = new SortCriterionContext {
|
||||
Query = groupQuery,
|
||||
State = FormParametersHelper.ToDynamic(sortCriterion.State),
|
||||
QueryPartRecord = queryRecord
|
||||
State = FormParametersHelper.ToDynamic(tokenizedState),
|
||||
QueryPartRecord = queryRecord,
|
||||
Tokens = tokens
|
||||
};
|
||||
|
||||
string category = sortCriterion.Category;
|
||||
@@ -212,7 +214,8 @@ namespace Orchard.Projections.Services {
|
||||
var filterContext = new FilterContext {
|
||||
Query = contentQuery,
|
||||
State = FormParametersHelper.ToDynamic(tokenizedState),
|
||||
QueryPartRecord = queryRecord
|
||||
QueryPartRecord = queryRecord,
|
||||
Tokens = tokens
|
||||
};
|
||||
|
||||
string category = filter.Category;
|
||||
@@ -236,10 +239,12 @@ namespace Orchard.Projections.Services {
|
||||
|
||||
// iterate over each sort criteria to apply the alterations to the query object
|
||||
foreach (var sortCriterion in sortCriteria.OrderBy(s => s.Position)) {
|
||||
var tokenizedState = _tokenizer.Replace(sortCriterion.State, tokens);
|
||||
var sortCriterionContext = new SortCriterionContext {
|
||||
Query = contentQuery,
|
||||
State = FormParametersHelper.ToDynamic(sortCriterion.State),
|
||||
QueryPartRecord = queryRecord
|
||||
State = FormParametersHelper.ToDynamic(tokenizedState),
|
||||
QueryPartRecord = queryRecord,
|
||||
Tokens = tokens
|
||||
};
|
||||
|
||||
string category = sortCriterion.Category;
|
||||
|
||||
Reference in New Issue
Block a user