Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-7094

DocumentSearchGeneratorImpl creates bad SQL when UI date format is changed

    Details

    • Type: Bug Fix
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.1
    • Fix Version/s: Backlog
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
    • Rice Module:
      KEW
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      DocumentSearchGeneratorImpl.establishDateString(..) generates SQL using DateTimeService.toDateString(Date). DateTimeServiceImpl uses the configuration parameter DATE_TO_STRING_FORMAT_FOR_USER_INTERFACE to create the string. This makes it so that changing the date format in the UI can lead to bad SQL being generated. I end up with the following:

      java.lang.RuntimeException: DataAccessException: ConnectionCallback; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00936: missing expression
      	at org.kuali.rice.kew.docsearch.dao.impl.DocumentSearchDAOJdbcImpl.findDocuments(DocumentSearchDAOJdbcImpl.java:113)
      	at org.kuali.rice.kew.docsearch.service.impl.DocumentSearchServiceImpl.lookupDocuments(DocumentSearchServiceImpl.java:170)
      

        Attachments

          Activity

          Hide
          kgeis Ken Geis added a comment -

          It turns out that for things to work,

          • STRING_TO_DATE_FORMATS must include DATE_TO_STRING_FORMAT_FOR_USER_INTERFACE
          • STRING_TO_TIMESTAMP_FORMATS must include DATE_TO_STRING_FORMAT_FOR_USER_INTERFACE + " HH:mm:ss"

          There should probably be code to validate these parameters and avoid this error.

          Show
          kgeis Ken Geis added a comment - It turns out that for things to work, STRING_TO_DATE_FORMATS must include DATE_TO_STRING_FORMAT_FOR_USER_INTERFACE STRING_TO_TIMESTAMP_FORMATS must include DATE_TO_STRING_FORMAT_FOR_USER_INTERFACE + " HH:mm:ss" There should probably be code to validate these parameters and avoid this error.

            People

            • Assignee:
              Unassigned
              Reporter:
              kgeis Ken Geis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: