Query Not Filtering by Date/Time Field

Topics: Troubleshooting
Jan 21, 2013 at 8:21 PM
Edited Jan 28, 2013 at 4:21 PM

Wondering if anyone else is having this issue. I have various content item types with the Date/Time field. The information is filled out, submitted, and in the database in both tables: Orchard_Projections_FieldIndexPartRecord and Orchard_Projections_IntegerFieldIndexRecord.

For some reason when I query these items, and filter by these date/time field results, I get no returns. As far as I can tell this is with any date/time field I create. Is anyone else seeing this?

UPDATE:

http://orchard.codeplex.com/workitem/19413

Jan 21, 2013 at 8:38 PM

So I also tried filtering by other fields in the form and I don't get any results there either.

Jan 23, 2013 at 3:23 PM

Did some searching, found this post: http://orchard.codeplex.com/discussions/388974

Going to make a new content type to see if this fixes it. If that is the case this really is going to be an issue going forward. Can anyone involved with the project confirm this as a bug or not?

Jan 23, 2013 at 3:45 PM
Edited Jan 23, 2013 at 4:33 PM

Found this: http://orchard.codeplex.com/workitem/19199

I submitted a screenshot there of what I am talking about. The query returns the results correctly when I am sorting by nothing, or sorting by a common part record (like creation date). When I add any type of item that is a custom part from this content item, it throws the below error. Hopefully this gets resolved soon, it was working fine in the old version.

An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
Exception of type 'Antlr.Runtime.MismatchedTokenException' was thrown. near line 6, column 61
NHibernate.Hql.Ast.ANTLR.QuerySyntaxException: Exception of type 'Antlr.Runtime.MismatchedTokenException' was thrown. near line 6, column 61 at NHibernate.Hql.Ast.ANTLR.ErrorCounter.ThrowQueryException() at NHibernate.Hql.Ast.ANTLR.HqlParseEngine.Parse() at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(String queryString, String collectionRole, Boolean shallow, IDictionary`2 filters, ISessionFactoryImplementor factory) at NHibernate.Engine.Query.HQLStringQueryPlan.CreateTranslators(String hql, String collectionRole, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(String queryString, Boolean shallow, IDictionary`2 enabledFilters) at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(String query, Boolean shallow) at NHibernate.Impl.AbstractSessionImpl.CreateQuery(String queryString) at Orchard.ContentManagement.DefaultHqlQuery.Slice(Int32 skip, Int32 count) in c:\Users\sebros\My Projects\Orchard\src\Orchard\ContentManagement\DefaultHqlQuery.cs:line 162 at Orchard.Projections.Services.ProjectionManager.GetContentItems(Int32 queryId, Int32 skip, Int32 count) at Orchard.Projections.Controllers.AdminController.Preview(Int32 id) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.b__10() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
Jan 28, 2013 at 4:19 PM
Edited Jan 28, 2013 at 4:22 PM

I have submitted a bug report here: http://orchard.codeplex.com/workitem/19413

I have also found a few related bug reports:

http://orchard.codeplex.com/workitem/19199

http://orchard.codeplex.com/workitem/19232

I'd really appreciate if someone would test to see if they have this problem as well. If so, please vote up the bug report.