{"record":{"id":"18324c9c6e1f05be","repo":"octobercms/october","slug":"editor-lang-filesystem-name-cant-be-empty","errorCode":null,"errorMessage":"editor::lang.filesystem.name_cant_be_empty","messagePattern":"editor::lang\\.filesystem\\.name_cant_be_empty","errorType":"validation","errorClass":"ApplicationException","httpStatus":null,"severity":"warning","filePath":"modules/editor/traits/FileSystemFunctions.php","lineNumber":62,"sourceCode":"            throw new ApplicationException(Lang::get('editor::lang.filesystem.already_exists'));\n        }\n\n        if (!File::makeDirectory($newFullPath, 0755, true, true)) {\n            throw new ApplicationException(Lang::get(\n                'editor::lang.filesystem.error_creating_directory',\n                ['name' => $newName]\n            ));\n        }\n    }\n\n    /**\n     * editorRenameFileOrDirectory\n     */\n    protected function editorRenameFileOrDirectory($basePath, $name, $originalPath, $allowedFileExtensions)\n    {\n        $newName = trim($name);\n        if (!strlen($newName)) {\n            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'));","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/editor/traits/FileSystemFunctions.php#L44-L80","documentation":"FileSystemFunctions::editorRenameFileOrDirectory validates the submitted rename value first: it trims the name and throws editor::lang.filesystem.name_cant_be_empty when nothing remains. This is the empty-input guard for the editor's rename operation, fired before any path or extension checks.","triggerScenarios":"Submitting a rename request with an empty or whitespace-only name; the editor UI sending the form before the rename input is populated; automated callers omitting the name parameter.","commonSituations":"Rename dialog submitted via Enter with an empty field; JS error clearing the input value; integrations scripting the editor API.","solutions":["Supply a non-empty new name in the rename request.","Disable the confirm button until the rename field has non-whitespace content.","Trim and validate client-side before posting.","Verify the parameter key the API expects for the new name."],"exampleFix":"// before\nname: '   '\n\n// after\nname: 'partials-v2'","handlingStrategy":"validation","validationCode":"$newName = trim((string) $name);\nif ($newName === '') {\n    throw new \\ValidationException(['name' => 'New name cannot be empty']);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Disable the rename confirm button until input is non-empty.","Trim values client-side before posting.","Cover the rename flow in editor UI tests."],"tags":["editor","filesystem","validation","rename"],"backgroundTag":"empty-filename","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}