This feature would allow admins to create a relativity query to define what children could be attached to a given node based on the type of the parent and the type of the child.
This may obviate the previous "Require Common Child of type $type" feature with one exception:
there would be no way of enforcing this relationship type after it was created.
This is because the reverse path from child back to parent is not obvious from a query definition. Additionally, the structure linking the two at the point the relationship is established may change and may or may not still relate parent to child, but not the reverse (well, not without specifying a separate "validation query" to validate the reverse path, currently beyond the scope of this feature).
If a query was used to define the set of possible children for a node, then new child nodes of the specified child type couldn't be created directly as children, but instead would have to be found as a result of a query. The list of result types would be reduced to only the type of the child being attached, which may override the query's result type list (which must include the child's type to even be considered).
When you click on the "attach existing $node_type child" link, the specified query is executed and a list of appropriate resulting children is presented to be attached. If the structure later changes, the child node will remain, even if the query then fails to find the child.
The admin settings for this would appear as a drop-down list of potential queries, each of which should include the child type in question as a possible result type. This will definitely be under the "advanced settings" tab.
Comments
Comment #1
javanaut commentedPoorly tested patch committed just now. It looks like it's working, but I wanted to commit this work before the weekend.
I decided to allow both "require common child" and "use relativity query" to offer up children that may be attached.
I'll do some more thorough testing of this new code over the weekend.
Comment #2
javanaut commentedforgot to set it to "fixed". Not closed still, as there is more testing to do...
Comment #3
(not verified) commented