Skip to content

Conversation

@larowlan
Copy link
Member

@larowlan larowlan commented Feb 9, 2017

  • getTree used old API
  • moveSubtreeToPosition assumed existing children in parent

$depthDiff = $newNode->getDepth() - $node->getDepth();
if (!$newNode) {
// No other children at this position, new depth = 1.
$depthDiff = 1 - $node->getDepth();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this, perhaps its better to get the previous node?
The issue is when you have parent at end of tree, there is no-one at the next position

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe hold off merging while I try it with a second level end-node

@larowlan larowlan merged commit b0cd906 into master Feb 9, 2017
@larowlan larowlan deleted the fix-get-tree branch February 9, 2017 01:13
@larowlan
Copy link
Member Author

larowlan commented Feb 9, 2017

self merging, let me know if any issues and will create follow ups

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants