{"record":{"id":"86c39fea0b912ab5","repo":"octobercms/october","slug":"editor-lang-filesystem-destination-not-found","errorCode":null,"errorMessage":"editor::lang.filesystem.destination_not_found","messagePattern":"editor::lang\\.filesystem\\.destination_not_found","errorType":"validation","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/editor/traits/FileSystemFunctions.php","lineNumber":183,"sourceCode":"        }\n\n        if (!strlen($destinationDir)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.select_destination_dir'));\n        }\n\n        if (!$this->validateFileSystemPath($destinationDir)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_path'));\n        }\n\n        // Ensure directory exists\n        $destinationFullPath = $basePath.'/'.$destinationDir;\n        if (!File::isDirectory($destinationFullPath)) {\n            File::makeDirectory($destinationFullPath, 0755, true, true);\n        }\n\n        // Path is gone\n        if (!file_exists($destinationFullPath) || !is_dir($destinationFullPath)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.destination_not_found'));\n        }\n\n        foreach ($selectedList as $path) {\n            if (!$this->validateFileSystemPath($path)) {\n                throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_path'));\n            }\n\n            $basename = basename($path);\n            $originalFullPath = $basePath.'/'.$path;\n            $newFullPath = rtrim($destinationFullPath, '/').'/'.$basename;\n            $safeDir = $basePath;\n\n            if ($originalFullPath == $newFullPath) {\n                continue;\n            }\n\n            if ((is_file($originalFullPath) && is_file($newFullPath))\n                || (is_dir($originalFullPath) && is_dir($newFullPath))) {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/editor/traits/FileSystemFunctions.php#L165-L201","documentation":"Thrown by editorMoveFilesOrDirectories when, after attempting File::makeDirectory($destinationFullPath, 0755, true, true), the destination still is not an existing directory (lines 176-184). Message: 'Destination directory is not found'. Since the code just tried to create it, the usual causes are: a regular FILE occupies that path (mkdir fails), the base path is unwritable so mkdir failed, or the base path itself does not exist.","triggerScenarios":"command_onAssetMove to 'js/bundle' when themes/<theme>/assets/js/bundle is an existing FILE (name collision); assets directory read-only for the PHP user so the recursive mkdir silently fails; the theme's assets folder was removed on disk while the Editor session stayed open.","commonSituations":"A file and desired folder share a name (e.g. 'partials' file vs 'partials/' dir); permission drift after deploys; moving into a path whose parent was deleted by git or another session.","solutions":["Check whether a FILE exists at the destination path and rename or delete it, then retry","Ensure themes/<theme>/assets is writable by the webserver user so the destination can be auto-created","Create the destination directory in the Editor (new directory command) first, then move","Refresh the sidebar if the parent directory may have been removed externally"],"exampleFix":"// before: themes/demo/assets/js/bundle is a FILE\n$ mv themes/demo/assets/js/bundle themes/demo/assets/js/bundle.txt\n// retry move to 'js/bundle' -> now auto-created as a directory","handlingStrategy":"validation","validationCode":"$destinationFullPath = $assetsBase.'/'.$destinationDir;\nif (file_exists($destinationFullPath) && !is_dir($destinationFullPath)) {\n    // a FILE occupies the path — the auto-mkdir will fail; rename/remove it first\n}\nif (!is_dir($destinationFullPath) && !is_writable($assetsBase)) {\n    // base not writable: the recursive mkdir cannot create the destination\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never let a file share a name with a directory path you plan to move into","Keep themes/<theme>/assets writable so destinations can be auto-created","Create the target folder via the Editor first if unsure"],"tags":["filesystem","directory-not-found","permissions","editor","winter-cms"],"backgroundTag":"directory-not-found","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}