This issue has been created
There is 1 update, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-0148a528-0c0b-4fc5-ac21-0ed921dcb322 XWIKI-25055 Open

Add support for dblist properties using a custom query in the link refactoring

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-21bb9048-146e-411a-8442-f1773d3960d5 Charpentier Lucas created this issue on 30/Sep/26 11:18
 
Summary: Add support for dblist properties using a custom query in the link refactoring
Issue Type: cid:jira-generated-image-avatar-0148a528-0c0b-4fc5-ac21-0ed921dcb322 Improvement
Assignee: Unassigned
Components: Link, Old Core
Created: 30/Sep/26 11:18
Priority: cid:jira-generated-image-static-major-8dce16a4-7256-4aeb-8b33-4984c0bd75f9 Major
Reporter: Charpentier Lucas
Description:

XWIKI-19219 adds support for database list properties in the link refactoring: the pages stored in such a property are listed as backlinks of the target page and are updated when that page is renamed or moved.

This only works for database lists whose values are known to be page references, i.e. when no custom query is used and the generated query selects doc.fullName as the stored value (only a class name, or doc.fullName as id or value field). A database list configured with a custom query is ignored, even when that query selects page references, so renaming a page leaves such a property pointing to the old page.

Possible approaches:

  • parse the custom query, for example with JSqlParser, to detect that its first selected column is doc.fullName. The query is HQL (or XWQL) and can contain Velocity that is evaluated against the current context before it runs, so this can only cover the simple cases;
  • add a meta property to database list properties, so that the class author can state explicitly that the stored values are page references.

See the discussion in https://github.com/xwiki/xwiki-platform/pull/6509#discussion_r4123416003

 
 

1 update

 
cid:jira-generated-image-avatar-21bb9048-146e-411a-8442-f1773d3960d5 Changes by Charpentier Lucas on 30/Sep/26 11:22
 
Description: XWIKI-19219 adds support for database list properties in the link refactoring: the pages stored in such a property are listed as backlinks of the target page and are updated when that page is renamed or moved.

This only works for database lists whose values are known to be page references, i.e. when no custom query is used and the generated query selects {{doc.fullName}} as the stored value (only a class name, or {{doc.fullName}} as id or value field). A database list configured with a custom query is ignored, even when that query selects page references, so renaming a page leaves such a property pointing to the old page.

Possible approaches:
* parse the custom query, for example with JSqlParser, to detect that its first selected column is {{doc.fullName}}. The query is HQL (or XWQL) and can contain Velocity that is evaluated against the current context before it runs, so this can only cover the simple cases;
* add a meta property to database list properties, so that the class author can state explicitly that the stored values are page references.

See the discussion in [ https://github.com/xwiki/xwiki-platform/pull/6509#discussion_r4123416003
]
 
 

1 comment

 
cid:jira-generated-image-avatar-21bb9048-146e-411a-8442-f1773d3960d5 Charpentier Lucas on 30/Sep/26 11:22
 

Possible approaches:

  • parse the custom query, for example with JSqlParser, to detect that its first selected column is doc.fullName. The query is HQL (or XWQL) and can contain Velocity that is evaluated against the current context before it runs, so this can only cover the simple cases;
  • add a meta property to database list properties, so that the class author can state explicitly that the stored values are page references.