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

Database list properties display the raw value instead of its label when the value isn't among the first allowed values returned by the query limit

    XMLWordPrintable

Details

    • Unknown

    Description

      Since XWIKI-23550, the allowed values of a Database List (and Page) property are loaded with at most security.queryItemsLimit results (1000 by default). The view and edit displayers look the label of the stored value up in that list, so a stored value that isn't in the first results is displayed as its raw value (e.g. a document name instead of its title).

      Steps to reproduce

      1. Set security.queryItemsLimit = 1 in xwiki.properties.
      2. Create a class with a Database List property whose query returns two columns (value, label) and at least two rows.
      3. Create an object with the value of the second row and view it.

      Expected

      The label of the value is displayed.

      Actual

      The raw value is displayed.

      The REST class property values resource (DBListClassPropertyValuesProvider#getValue) already avoids this by filtering the query on the requested value; DBListClass should look the missing values up the same way instead of relying on the first results only.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: