{"record":{"id":"80f2c97875272abb","repo":"octobercms/october","slug":"editor-lang-filesystem-selected-files-not-found","errorCode":null,"errorMessage":"editor::lang.filesystem.selected_files_not_found","messagePattern":"editor::lang\\.filesystem\\.selected_files_not_found","errorType":"validation","errorClass":"ApplicationException","httpStatus":null,"severity":"warning","filePath":"modules/editor/traits/FileSystemFunctions.php","lineNumber":164,"sourceCode":"\n                    if (!@rmdir($fullPath)) {\n                        throw new ApplicationException(Lang::get(\n                            'editor::lang.filesystem.error_deleting_dir',\n                            ['name' => $path]\n                        ));\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * editorMoveFilesOrDirectories\n     */\n    protected function editorMoveFilesOrDirectories($basePath, $selectedList, $destinationDir)\n    {\n        if (!count($selectedList)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.selected_files_not_found'));\n        }\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)) {","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/editor/traits/FileSystemFunctions.php#L146-L182","documentation":"Thrown by editorMoveFilesOrDirectories when the $selectedList ('source') array is empty (lines 163-165). Message: 'Selected files not found'. It is a pure precondition check — nothing has been touched yet — and exists because a move command with no sources is meaningless; the sidebar UI normally makes it unreachable.","triggerScenarios":"command_onAssetMove with documentData 'source' => [] — e.g. a drag-and-drop that failed to register the selection, a stale page where the selection was cleared, or a custom API client posting an empty array (a missing key would instead fail earlier in ApiHelpers::assertGetKey).","commonSituations":"Custom scripts integrating with the editor endpoints; UI edge cases where a node drag starts before selection state is set; automated tests exercising the move command with placeholder payloads.","solutions":["Re-select the files/folders in the sidebar and repeat the move","If scripting the API, always send a non-empty 'source' array of relative paths","Update the page (clear stale selection state) and try again","Check your request payload actually serializes the selection (network tab: 'source' must be a JSON array)"],"exampleFix":"// before\n{ \"source\": [], \"destination\": \"js\" }\n// after\n{ \"source\": [\"css/old.css\"], \"destination\": \"js\" }","handlingStrategy":"validation","validationCode":"if (!is_array($source) || !count($source)) {\n    // do not send the move command; re-select items in the sidebar\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always send a non-empty 'source' array in move payloads","In custom UIs, guard the move action on a non-empty selection","Verify payload serialization in the network tab when moves mysteriously fail"],"tags":["filesystem","validation","request-payload","editor","winter-cms"],"backgroundTag":"missing-request-parameter","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}