Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-12613

Search service with date criterion does not work anymore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • 4.9.5, 4.10.0
    • None
    • None
    • None
    • 4.10 M3

      Create a search service on news with a criterion on start date
      The format date yyy-MM-dd is no more supported by serveur side.

      org.ametys.runtime.model.exception.BadItemTypeException: Unable to cast '2025-12-10' to a date
      	at org.ametys.core.model.type.BaseDateTimeElementType.convertValue(BaseDateTimeElementType.java:63)
      	at org.ametys.core.model.type.BaseDateTimeElementType.convertValue(BaseDateTimeElementType.java:1)
      	at org.ametys.core.model.type.AbstractElementType.castValue(AbstractElementType.java:842)
      	at org.ametys.core.model.type.AbstractElementType._singleValueFromJSON(AbstractElementType.java:153)
      	at org.ametys.core.model.type.AbstractElementType.fromJSONForClient(AbstractElementType.java:130)
      	at org.ametys.web.frontoffice.search.metamodel.SearchServiceCriterionDefinition.convertRestrictedValue(SearchServiceCriterionDefinition.java:83)
      	at org.ametys.web.frontoffice.search.requesttime.impl.SearchComponentHelper.convertUserCriterionValue(SearchComponentHelper.java:292)
      	at org.ametys.web.frontoffice.search.requesttime.impl.SearchComponentHelper.checkValidInputValues(SearchComponentHelper.java:276)
      	at org.ametys.web.frontoffice.search.requesttime.impl.SearchComponentHelper.checkValidInputs(SearchComponentHelper.java:216)
      	at org.ametys.web.frontoffice.search.requesttime.impl.SearchComponentHelper.getCriterionTreeQuery(SearchComponentHelper.java:127)
      	at org.ametys.web.frontoffice.search.requesttime.impl.CriterionTreeSearchComponent.execute(CriterionTreeSearchComponent.java:58)
      	at org.ametys.web.frontoffice.search.requesttime.SearchServiceGenerator.generate(SearchServiceGenerator.java:166)
      

      Changing the server date format to yy-mm-dd'T00:00:00.000Z' for date picker works but search engine does not returns news with a start date with hours not equals to 00:00

      Create a search service on news with a criterion on start date is today (relative date)
      On a 4.8 the search engien returns news with a start date to today at 00:00 and news with a start date to today at 4:00pm.
      On a 4.9 the search engine only returns the new with a start date to 00:00

            cbayle Caroline Bayle
            laurence Laurence Aumeunier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: