Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-23781

No used values suggested for list fields on Oracle

    XMLWordPrintable

Details

    • Unknown

    Description

      Steps to reproduce:

      1. Create a new XClass by editing any document with the class editor.
      2. Add a property "myList" of type "Static List"
      3. For this property, set "Display Type" to "input".
      4. Save the XClass
      5. Add an object of the class to any page using the object editor. Set the value to "Option 1" and save the page.
      6. Open the object editor on another page, add an object of the class and type "Option" in the myList input.

      Expected result:

      The previously set value "Option 1" is suggested.

      Actual result:

      No values are suggested. In the network tab of the developer tools, a failed request is displayed with response

      org.xwiki.query.QueryException: Exception while executing query. Query statement = [select prop.value, str(prop.value) as unfilterable1 from BaseObject as obj, StringProperty as prop where obj.className = :className and obj.name <> :templateName and prop.id.id = obj.id and prop.id.name = :propertyName order by unfilterable1 desc]
      ClassCastException: class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')
        

      When adding a Live Data for this class with 

      {{liveData
        id="test"
        properties="doc.name,myList"
        limit="5"
        source="liveTable"
        sourceParameters="translationPrefix=&className=NestedLiveDataIT.filterWithRelationalDBList.WebHome"
      }}{{/liveData}}
      

       
      the same error can be observed when typing in the filter for "myList" as it triggers the same code.

      The cast that is mentioned in the error is from https://github.com/xwiki/xwiki-platform/blob/b320aea672a8daa96226dde94300c973e56f5972/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/objects/classes/UsedValuesListQueryBuilder.java#L83 which is triggered because the second value is no count anymore since XWIKI-23019. I've reverted the change of that issue and then the values were suggested as expected.

      For XWIKI-23727 I'm adding an integration test that reproduces the scenario with Live Data for the special case of (database) list properties with relational storage and multi select.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: