}\r
// Enf of backward compatibility\r
\r
+function getID($path) {\r
+ // use the share table from the db to find the item source if the file was reshared because shared files are not stored in the file cache.\r
+ if (substr(OC_Filesystem::getMountPoint($path), -7, 6) == "Shared") {\r
+ $path_parts = explode('/', $path, 5);\r
+ $user = $path_parts[1];\r
+ $intPath = '/'.$path_parts[4];\r
+ $query = \OC_DB::prepare('SELECT item_source FROM *PREFIX*share WHERE uid_owner = ? AND file_target = ? ');\r
+ $result = $query->execute(array($user, $intPath));\r
+ $row = $result->fetchRow();\r
+ $fileSource = $row['item_source'];\r
+ } else {\r
+ $fileSource = OC_Filecache::getId($path, '');\r
+ }\r
+\r
+ return $fileSource;\r
+}\r
+\r
if (isset($_GET['file']) || isset($_GET['dir'])) {\r
if (isset($_GET['dir'])) {\r
$type = 'folder';\r
$uidOwner = substr($path, 1, strpos($path, '/', 1) - 1);\r
if (OCP\User::userExists($uidOwner)) {\r
OC_Util::setupFS($uidOwner);\r
- $fileSource = OC_Filecache::getId($path, '');\r
+ $fileSource = getId($path);\r
if ($fileSource != -1 && ($linkItem = OCP\Share::getItemSharedWithByLink($type, $fileSource, $uidOwner))) {\r
// TODO Fix in the getItems\r
if (!isset($linkItem['item_type']) || $linkItem['item_type'] != $type) {\r