octobercms/october · warning · ApplicationException
editor::lang.filesystem.name_cant_be_empty
Error message
editor::lang.filesystem.name_cant_be_empty
What it means
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.
Source
Thrown at modules/editor/traits/FileSystemFunctions.php:62
throw new ApplicationException(Lang::get('editor::lang.filesystem.already_exists'));
}
if (!File::makeDirectory($newFullPath, 0755, true, true)) {
throw new ApplicationException(Lang::get(
'editor::lang.filesystem.error_creating_directory',
['name' => $newName]
));
}
}
/**
* editorRenameFileOrDirectory
*/
protected function editorRenameFileOrDirectory($basePath, $name, $originalPath, $allowedFileExtensions)
{
$newName = trim($name);
if (!strlen($newName)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.name_cant_be_empty'));
}
if (!$this->validateFileSystemPath($newName)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_path'));
}
if (!$this->validateFileSystemName($newName)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_name'));
}
$originalPath = trim($originalPath);
if (!$this->validateFileSystemPath($originalPath)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_path'));
}
$originalFullPath = $basePath.'/'.$originalPath;
if (!file_exists($originalFullPath)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.original_not_found'));View on GitHub (pinned to b608633a7e)
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.
Example fix
// before name: ' ' // after name: 'partials-v2'
Defensive patterns
Strategy: validation
Validate before calling
$newName = trim((string) $name);
if ($newName === '') {
throw new \ValidationException(['name' => 'New name cannot be empty']);
} Prevention
- Disable the rename confirm button until input is non-empty.
- Trim values client-side before posting.
- Cover the rename flow in editor UI tests.
When it happens
Trigger: 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.
Common situations: Rename dialog submitted via Enter with an empty field; JS error clearing the input value; integrations scripting the editor API.
Related errors
- editor::lang.filesystem.directory_name_cant_be_empty
- editor::lang.filesystem.type_not_allowed
- editor::lang.filesystem.error_deleting_dir_not_empty
- editor::lang.filesystem.selected_files_not_found
- editor::lang.filesystem.select_destination_dir
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/18324c9c6e1f05be.
Report an issue: GitHub.