Details
-
Bug
-
Resolution: Unresolved
-
Blocker
-
17.2.0, 16.10.6, 16.4.8
-
Unknown
-
Description
Steps to reproduce:
- Create a new XClass by editing any document with the class editor.
- Add a property "myList" of type "Static List"
- For this property, set "Display Type" to "input".
- Save the XClass
- Add an object of the class to any page using the object editor. Set the value to "Option 1" and save the page.
- 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
- is caused by
-
XWIKI-23019 Oracle inconsistent datatypes error when using user suggest for multiple users
-
- Closed
-