This issue has been created
 
 
Farm Tools / cid:jira-generated-image-avatar-60e10192-4a5c-4331-9caa-0f7f594cf9a1 FARMTOOLS-22 Open

The default language updater compares the translation flag of the pages with a string

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-392b59e4-2106-4e34-8cb7-7ef9beffae3f Thomas Mortagne created this issue on 17/Nov/26 15:11
 
Summary: The default language updater compares the translation flag of the pages with a string
Issue Type: cid:jira-generated-image-avatar-60e10192-4a5c-4331-9caa-0f7f594cf9a1 Bug
Affects Versions: 2.7
Assignee: Unassigned
Components: Farm updater
Created: 17/Nov/26 15:11
Priority: cid:jira-generated-image-static-major-706c694d-c62c-49a4-b59c-c2fec868a346 Major
Reporter: Thomas Mortagne
Description:

FarmTools.DefaultLanguageUpdater compares the translation flag of the pages, which is an integer, with a string:

doc.translation='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.

Compare it with a number instead (doc.translation = 0). This works with all the databases and all the Hibernate versions.