diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Services/ProjectionManager.cs b/src/Orchard.Web/Modules/Orchard.Projections/Services/ProjectionManager.cs index 6f03d1c94..6a1a0368e 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Services/ProjectionManager.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Services/ProjectionManager.cs @@ -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;