Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When the parent bundle is revisionable, but has no parent field of its own - saving a new revision of the parent causes the children to be lost in the nested set if you use the node key factory to turn the parent entity into a NodeKey, and then use that to query the storage.
Proposed resolution
Fix it
Remaining tasks
All
User interface changes
None
API changes
None
Data model changes
TBC
Comment | File | Size | Author |
---|---|---|---|
#6 | 2855095-orphaned.pass_.patch | 18.65 KB | larowlan |
#4 | 2855095-orphaned.fail_.patch | 6.01 KB | larowlan |
Comments
Comment #2
larowlanComment #4
larowlanComment #6
larowlanComment #7
jibran`$settings['target_bundles'] = NULL` means all bundles so imo this should be `$settings['target_bundles'] === NULL` check.
We can move `$storage->getNode($existingParent->getNodeKey())` out of the loop.
Comment #8
larowlan1. !isset is same as === NULL? https://3v4l.org/rL4fU
2. we have to get the node each time, as parent left/right can be updated by moving things in the tree (this was the bug I mentioned this morning)
Comment #10
larowlan