From 2fb14816136f9d54375215174f33109c027e00d2 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Thu, 14 Jul 2011 12:40:12 -0400 Subject: [PATCH] Bug fix for setTarget() - append fetchAll() to query --- apps/files_sharing/lib_share.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index 804379f830..b529f7e694 100644 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -207,7 +207,7 @@ class OC_SHARE { // A new entry is added to the database when a file within a shared folder is renamed or is moved outside the original target folder $query = OC_DB::prepare("SELECT uid_owner, is_writeable FROM *PREFIX*sharing WHERE source = ? AND uid_shared_with = ? LIMIT 1"); $folders = OC_SHARE::getParentFolders($oldTarget, false); - $result = $query->execute(array($folders['source'], $_SESSION['user_id'])); + $result = $query->execute(array($folders['source'], $_SESSION['user_id']))->fetchAll(); $query = OC_DB::prepare("INSERT INTO *PREFIX*sharing VALUES(?,?,?,?,?)"); $source = $folders['source'].substr($oldTarget, strlen($folders['target'])); $query->execute(array($result[0]['uid_owner'], $_SESSION['user_id'], $source, $newTarget, $result[0]['is_writeable']));