{"record":{"id":"811a7e763efbef2d","repo":"octobercms/october","slug":"editor-lang-filesystem-original-not-found","errorCode":null,"errorMessage":"editor::lang.filesystem.original_not_found","messagePattern":"editor::lang\\.filesystem\\.original_not_found","errorType":"validation","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/editor/traits/FileSystemFunctions.php","lineNumber":80,"sourceCode":"            throw new ApplicationException(Lang::get('editor::lang.filesystem.name_cant_be_empty'));\n        }\n\n        if (!$this->validateFileSystemPath($newName)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_path'));\n        }\n\n        if (!$this->validateFileSystemName($newName)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_name'));\n        }\n\n        $originalPath = trim($originalPath);\n        if (!$this->validateFileSystemPath($originalPath)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_path'));\n        }\n\n        $originalFullPath = $basePath.'/'.$originalPath;\n        if (!file_exists($originalFullPath)) {\n            throw new ApplicationException(Lang::get('editor::lang.filesystem.original_not_found'));\n        }\n\n        if (!is_dir($originalFullPath) && !$this->validateFileSystemFileExtension($newName, $allowedFileExtensions)) {\n            throw new ApplicationException(Lang::get(\n                'editor::lang.filesystem.type_not_allowed',\n                ['allowed_types' => implode(', ', $allowedFileExtensions)]\n            ));\n        }\n\n        // Block renaming to a .svg target\n        if (\n            !is_dir($originalFullPath) &&\n            Config::get('media.clean_vectors', true) &&\n            strtolower(File::extension($newName)) === 'svg' &&\n            strtolower(File::extension($originalPath)) !== 'svg'\n        ) {\n            throw new ApplicationException(Lang::get(\n                'editor::lang.filesystem.type_not_allowed',","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/editor/traits/FileSystemFunctions.php#L62-L98","documentation":"Thrown by editorRenameFileOrDirectory when file_exists($basePath.'/'.$originalPath) is false (line 80). The rename target must already exist under the managed base path (for the CMS extension this is themes/<theme>/assets). It means the path passed validation but nothing lives there, usually because the node in the sidebar is stale.","triggerScenarios":"command_onAssetRename with an originalPath that no longer exists under themes/<active-theme>/assets: the file was deleted or moved in another tab/session, a deploy or git checkout removed it, the request's 'theme' metadata points at a different theme than the one whose assets are shown, or the casing differs on a case-sensitive filesystem.","commonSituations":"Two people (or two tabs) editing the same theme's assets; assets replaced by CI/CD while the Editor stays open; switching themes while the sidebar still shows the previous theme's tree; developing on macOS/Windows and deploying to Linux where 'Logo.CSS' != 'logo.css'.","solutions":["Refresh the Editor sidebar (or reload the page) so the tree reflects the real filesystem, then rename again","Verify the file exists under themes/<theme>/assets/ for the theme sent in the request metadata","Confirm the theme in the request matches the theme whose assets are displayed (validateRequestTheme should already pin this)","If an external process removed the file, restore it (git checkout / redeploy) before renaming"],"exampleFix":"// before\n$originalPath = 'css/removed-file.css'; // deleted by a deploy\n\n// after\n$originalPath = 'css/current-file.css'; // re-selected from a refreshed sidebar","handlingStrategy":"validation","validationCode":"$originalFullPath = $assetsBase.'/'.$originalPath; // $assetsBase = themes/<theme>/assets\nif (!file_exists($originalFullPath)) {\n    // stale sidebar node: refresh tree / re-select before renaming\n}","typeGuard":null,"tryCatchPattern":"try {\n    // rename via editor command or editorRenameFileOrDirectory(...)\n} catch (ApplicationException $e) {\n    if ($e->getMessage() === Lang::get('editor::lang.filesystem.original_not_found')) {\n        // reload the document list, the node is stale\n    }\n}","preventionTips":["Refresh the sidebar after deploys or external changes before renaming","Verify the theme in the request metadata matches the assets being browsed","Treat case differences as distinct names when moving between macOS/Windows and Linux"],"tags":["filesystem","file-not-found","stale-state","editor","winter-cms"],"backgroundTag":"file-not-found","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}