Description
When a node has lost its reference to more than one child only one child node entry is fixed.
This is because the bundles that need modification are first all stored in a collection before being stored as the last step.
The process is something like the following:
1. node n1 is checked, the parent bundle p1 of n1 is loaded from pm
2. p1 does not have a child node entry for n1
3. a child node entry to n1 is added to p1
4. p1 is added to the collection of bundles to be saved when all checking has been done
5. node n2 is checked, the parent bundle p1 of n2 is loaded from pm (without the previous modifications because the bundle was not yet stored)
6. p1 does not have a child node entry for n2
7. a child node entry to n2 is added to p1
8 p1 is added to the collection of bundles to be saved when all checking has been done
9 after all checking has been done the collections of modified bundles is iterated over
10. p1 is in the collection twice, once with a fix for n1 and once with a fix for n2
11 last one wins and p1 still doesn't have a child node entry for n1
I'll attach a patch with a proposed fix.