Skip to content

Conversation

dbu
Copy link
Member

@dbu dbu commented Dec 6, 2014

Fix #255

Test added in phpcr/phpcr-api-tests#144

@@ -471,6 +475,9 @@ public function rename($newName)
}

$this->session->move($this->path, $newPath);
if ($next) {
$this->getParent()->orderBefore($newName, $next);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

this is maybe not the most elegant way of solving this, but the impact is low and i see rename as a shortcut for this operation anyways. and lacking native support in the transport layer, this would just end up the same way if we would add an internal method that unifies move and rename. (Session::move does a couple of important checks to avoid name collisions).

Copy link
Member

Choose a reason for hiding this comment

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

this doesn't cause issues when doing a rename and an explicit move in the same transaction?

Copy link
Contributor

Choose a reason for hiding this comment

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

@lsmith77 it shouldn't do surely as we are simply using the session API here?

Copy link
Member Author

Choose a reason for hiding this comment

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

if there is a problem, it would also occur when i do orderBefore and then move the node. but i think with the activity log we now have, it should work out.

lsmith77 added a commit that referenced this pull request Dec 12, 2014
A node must keep its position relative to its siblings when being renamed
@lsmith77 lsmith77 merged commit 62ae18f into master Dec 12, 2014
@lsmith77 lsmith77 deleted the keep-position-when-renaming branch December 12, 2014 15:57
@lsmith77
Copy link
Member

for the record, this should actually be handled inside the transport layer to ensure that the most efficient strategy is used to handle this .. but lets keep this for 2.0 (it was added to the todo list there)

@dbu
Copy link
Member Author

dbu commented Dec 12, 2014

@dantleech
Copy link
Contributor

@dbu was this reverted?

@dbu
Copy link
Member Author

dbu commented Apr 22, 2015

not that i would be aware of. did the code disapear from master?

@dantleech
Copy link
Contributor

no sorry, my mistake. Its fine :) I had git log confusion.

@hacfi
Copy link

hacfi commented Apr 23, 2015

@dbu Nope..all good.

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.

Node rename changes node position
4 participants