Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

[WIP] Fixed reorder to 0 #30

Merged
merged 1 commit into from
Jul 4, 2016
Merged

[WIP] Fixed reorder to 0 #30

merged 1 commit into from
Jul 4, 2016

Conversation

dantleech
Copy link
Member

This PR fixes the scenario where a node needs to be repositoned to 0. Need to add tests.

@@ -140,7 +140,9 @@ public function reorderNode($sourcePath, $position)
$parent = $node->getParent();
$nodeNames = $parent->getNodeNames();

if (isset($nodeNames[$position + 1])) {
if ($position == 0) {
$parent->orderBefore($node->getName(), $nodeNames[$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.

Other edge cases here? $nodeNames[0] should always be set.

@dantleech
Copy link
Member Author

This functionality is covered by the functional tests in the bundle, merging.

@dantleech dantleech merged commit 012d553 into master Jul 4, 2016
@dantleech dantleech deleted the fixed_zero_reorder branch July 4, 2016 08:09
@dantleech dantleech removed the wip/poc label Jul 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant