Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 0266e1f

Browse files
committed
Correctly change index for children whose ancestors dir name changed
1 parent d9ded37 commit 0266e1f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/src/plugins/meta.syncable/class.ChangesTracker.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,11 @@ public function updateNodesIndex($oldNode = null, $newNode = null, $copy = false
564564
$this->logDebug('UPDATE FOLDER PATH', $newNode->getUrl());
565565
dibi::query("UPDATE [ajxp_index] SET [node_path]=REPLACE( REPLACE(CONCAT('$$$',[node_path]), CONCAT('$$$', %s), CONCAT('$$$', %s)) , '$$$', '') ",
566566
SystemTextEncoding::toUTF8($oldNode->getPath()),
567-
SystemTextEncoding::toUTF8($newNode->getPath())
568-
, "WHERE [node_path] = %s AND [repository_identifier] = %s", SystemTextEncoding::toUTF8($oldNode->getPath()), $repoId);
567+
SystemTextEncoding::toUTF8($newNode->getPath()),
568+
"WHERE ([node_path] = %s OR [node_path] LIKE %like~) AND [repository_identifier] = %s",
569+
SystemTextEncoding::toUTF8($oldNode->getPath()),
570+
rtrim(SystemTextEncoding::toUTF8($oldNode->getPath()), '/') . '/',
571+
$repoId);
569572
try{
570573
$rowCount = dibi::getAffectedRows();
571574
if($rowCount === 0){

0 commit comments

Comments
 (0)