mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-20 19:39:16 -04:00
in move_to(), move the lock to before we do any calculations so that we have the latest data.
This commit is contained in:
@@ -232,6 +232,10 @@ class ORM_MPTT_Core extends ORM {
|
||||
throw new Exception("@todo INVALID_TARGET can't move item inside itself");
|
||||
}
|
||||
|
||||
$this->lock();
|
||||
$this->reload(); // Assume that the prior lock holder may have changed this entry
|
||||
$target->reload();
|
||||
|
||||
$number_to_move = (int)(($this->right_ptr - $this->left_ptr) / 2 + 1);
|
||||
$size_of_hole = $number_to_move * 2;
|
||||
$original_left_ptr = $this->left_ptr;
|
||||
@@ -239,9 +243,6 @@ class ORM_MPTT_Core extends ORM {
|
||||
$target_right_ptr = $target->right_ptr;
|
||||
$level_delta = ($target->level + 1) - $this->level;
|
||||
|
||||
$this->lock();
|
||||
$this->reload(); // Assume that the prior lock holder may have changed this entry
|
||||
$target->reload();
|
||||
try {
|
||||
if ($level_delta) {
|
||||
// Update the levels for the to-be-moved items
|
||||
|
||||
Reference in New Issue
Block a user