#111444Resolve descendants for the tree parent loop protection with one query
Description
When the parent field of a record in a tree relation to its own table is edited (e.g. `sys_category.parent`), the record and all its descendants are marked unselectable (#91608). The descendants are looked up level by level, with one query per descendant.
A recursive CTE resolves the whole subtree in one query and follows workspace versions, so a record moved to another parent in a workspace is found below its new parent.
Fields whose records can have several parents (MM, `foreign_field`, comma separated lists) keep the current lookup.
Reviews 1
History 02
-
Gerrit Code Review pushed patch set 1 for main to change 97633 status
NewUnder Review <span data-processor="relativetime" data-value="2026-11-13T20:33:03+00:00" > 11/13/26, 20:33 </span> -
Gerrit Code Review pushed patch set 2 for main to change 97633 <span data-processor="relativetime" data-value="2026-11-15T01:14:28+00:00" > 11/15/26, 01:14 </span>