If you have moved Nodes in a workspace (multiple NodeData-Entries, one removed), the NodeDataRepository sometimes reduces the Result to the removed NodeData.
Situation, the Bug appears
We had a workspace for restructuring the NodeTree of the current Website. In this workspace, some nodes where moved to other locations in the tree. Then the Editor wasn't able to find some of the moved nodes via the Search above NodeTree (neither in references-fields).
It turned out, that the NodeDataRepository queried the NodeData-entries correctly. Just the Method \Neos\ContentRepository\Domain\Repository\NodeDataRepository::reduceNodeVariantsByWorkspacesAndDimensions() reduced the Result to only the removed NodeData entry. Since removed NodeData's are filtered out, this leaded to 0 Results in the search.
Why does it happen?
The priorities that are used for reduction in reduceNodeVariantsByWorkspacesAndDimensions() are dimensionValues and workspace. It's reducing the the Nodes to the best match(es) depending on the source-dimensions and workspace. But if you have moved one node, there are 2 same priorities for dimensions and workspace. Depending on the sql-result-order (Persistence-Identifier), it get's the removed or the not removed NodeData. This is because the state (removed/not removed) isn't a priority here.
Steps to Reproduce
Create a Workspace and switch into it
Move multiple documents in NodeTree. (You need luck to get the "wrong" order of generated UUID to reproduce the Bug)
Pulblish changes to workspace
Try to search for the moved DocumentNodes. If you got the "wrong" UUID-Order, you won't find it in search, but it's in the tree.
Description
If you have moved Nodes in a workspace (multiple NodeData-Entries, one removed), the NodeDataRepository sometimes reduces the Result to the removed NodeData.
Situation, the Bug appears We had a workspace for restructuring the NodeTree of the current Website. In this workspace, some nodes where moved to other locations in the tree. Then the Editor wasn't able to find some of the moved nodes via the Search above NodeTree (neither in references-fields).
It turned out, that the NodeDataRepository queried the NodeData-entries correctly. Just the Method
\Neos\ContentRepository\Domain\Repository\NodeDataRepository::reduceNodeVariantsByWorkspacesAndDimensions()
reduced the Result to only the removed NodeData entry. Since removed NodeData's are filtered out, this leaded to 0 Results in the search.Why does it happen? The priorities that are used for reduction in
reduceNodeVariantsByWorkspacesAndDimensions()
aredimensionValues
andworkspace
. It's reducing the the Nodes to the best match(es) depending on the source-dimensions and workspace. But if you have moved one node, there are 2 same priorities for dimensions and workspace.Depending on the sql-result-order (Persistence-Identifier), it get's the removed or the not removed NodeData. This is because the state (removed/not removed) isn't a priority here.
Steps to Reproduce
Affected Versions
Neos: Tested starting from 5.3
Bugfix
See #3652