Uploaded image for project: 'Document Accordion Macro'
  1. Document Accordion Macro
  2. DOCACCORDI-16

Excluding the hidden pages compares their hidden flag with a number

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 1.1.4
    • None
    • Unknown

    Description

      DocAccordionMacro excludes the hidden pages by comparing their hidden flag with a number:

      AND doc.hidden=0
      

      Since Hibernate 6, HQL checks the types of both sides of a comparison when the query is parsed, and rejects incompatible ones (SemanticException: Cannot compare left expression of type ... with right expression of type ...). XWiki is moving to Hibernate 7 (XWIKI-19708), where these queries will fail on every database. With Hibernate 5 the literal is copied as is in the SQL, so the queries rely on the database converting it implicitly, which not all databases do.

      This probably already fails on PostgreSQL, where the hidden flag is stored in a boolean column which can't be compared with an integer.

      Compare it with a boolean instead (doc.hidden = false). This works with all the databases and all the Hibernate versions.

      PS: This post was co-written with Claude Code.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tmortagne Thomas Mortagne
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: