Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-7094

DocumentSearchGeneratorImpl creates bad SQL when UI date format is changed

    Details

    • Type: Bug Fix Bug Fix
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.1
    • Fix Version/s: Backlog
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
    • Similar issues:
      KULRICE-12248DocumentSearchGeneratorImpl#getSearchableAttributeSql does not handle searchable attributes well if document type changes
      KULRICE-7159jscalendar date inputs do not honor DATE_TO_STRING_FORMAT_FOR_USER_INTERFACE
      KULRICE-13302RoleDaoJdbc creates invalid sql statement when saving new proposal
      KULRICE-2914Add system parameters related to date format extraction
      KULRICE-308date/time ui/db formats / standards
      KULRICE-13320KRMS agenda editor UI handles '>' operator badly
      KULRICE-2926Verify that common Date and Time formats are being used at the UI layer across all modules
      KULRICE-363Date as key field - not formatted properly for inquiry url
      KULRICE-4747OJB bad SQL grammar on Routing Rules Delegation lookup
      KULRICE-7690Date Approved Workflow Preference can cause an excessive amount of sql queries
    • 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)
      

        Activity

        Hide
        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
        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:
            Ken Geis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Structure Helper Panel