diff --git a/Controller/CabinetFilesEditController.php b/Controller/CabinetFilesEditController.php index 2f7b155..39758fb 100644 --- a/Controller/CabinetFilesEditController.php +++ b/Controller/CabinetFilesEditController.php @@ -715,6 +715,6 @@ private function __isExistsParentFolder() { $this->request->named, 'parent_id' ); - return $this->CabinetFile->isExists($this->_cabinet['Cabinet']['key'], $parentId); + return $this->CabinetFile->isExistsByTreeId($this->_cabinet['Cabinet']['key'], $parentId); } } diff --git a/Model/CabinetFile.php b/Model/CabinetFile.php index d89019f..d0ebb0e 100644 --- a/Model/CabinetFile.php +++ b/Model/CabinetFile.php @@ -574,13 +574,13 @@ public function isAllowUnzip($cabinetFile) { * isExists * * @param string $cabinetKey Caibnet.key - * @param string|int $cabinetFileId CabinetFile.id + * @param string|int $cabinetFileTreeId CabinetFile.id * @return bool */ - public function isExists($cabinetKey, $cabinetFileId) { + public function isExistsByTreeId($cabinetKey, $cabinetFileTreeId) { $conditions = [ 'CabinetFile.cabinet_key' => $cabinetKey, - 'CabinetFile.id' => $cabinetFileId, + 'CabinetFile.cabinet_file_tree_id' => $cabinetFileTreeId, ]; $conditions = $this->getWorkflowConditions($conditions); $count = $this->find('count', ['conditions' => $conditions]);