octobercms/october · warning · ApplicationException
editor::lang.filesystem.select_destination_dir
Error message
editor::lang.filesystem.select_destination_dir
What it means
Thrown by editorMoveFilesOrDirectories when $destinationDir is an empty string (lines 167-169). Message: 'Please select a destination directory'. It is the second pure precondition of the move command: moving requires an explicit destination, and even the assets root must be sent as '/', not ''.
Source
Thrown at modules/editor/traits/FileSystemFunctions.php:168
['name' => $path]
));
}
}
}
}
}
/**
* editorMoveFilesOrDirectories
*/
protected function editorMoveFilesOrDirectories($basePath, $selectedList, $destinationDir)
{
if (!count($selectedList)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.selected_files_not_found'));
}
if (!strlen($destinationDir)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.select_destination_dir'));
}
if (!$this->validateFileSystemPath($destinationDir)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.invalid_path'));
}
// Ensure directory exists
$destinationFullPath = $basePath.'/'.$destinationDir;
if (!File::isDirectory($destinationFullPath)) {
File::makeDirectory($destinationFullPath, 0755, true, true);
}
// Path is gone
if (!file_exists($destinationFullPath) || !is_dir($destinationFullPath)) {
throw new ApplicationException(Lang::get('editor::lang.filesystem.destination_not_found'));
}
foreach ($selectedList as $path) {View on GitHub (pinned to b608633a7e)
Solutions
- Send '/' when moving to the assets root instead of an empty string
- Re-do the drag-and-drop onto a visible directory node in the sidebar
- In custom clients, default destination to '/' when the user picks the tree root
- Check the network request to confirm 'destination' is present and non-empty
Example fix
// before
{ "source": ["css/a.css"], "destination": "" }
// after
{ "source": ["css/a.css"], "destination": "/" } Defensive patterns
Strategy: validation
Validate before calling
$destinationDir = trim((string) $destination);
if ($destinationDir === '') {
$destinationDir = '/'; // assets root must be '/', never empty
} Prevention
- Encode the assets root as '/', not an empty string
- Default destination to '/' in custom clients when the tree root is chosen
- Keep the drag handler's root-node path property set to '/'
When it happens
Trigger: command_onAssetMove with documentData 'destination' => '' — typically a custom client encoding the root directory as an empty string, or a drag handler that resolves 'dropped on root' to '' instead of '/'.
Common situations: Custom integrations and tests replaying editor commands; modified/extension sidebar code where the root node's path property is empty; payloads built from trim()-ed user input that becomes ''.
Related errors
- editor::lang.filesystem.selected_files_not_found
- editor::lang.filesystem.type_not_allowed
- editor::lang.filesystem.error_deleting_dir_not_empty
- editor::lang.filesystem.destination_exists
- editor::lang.filesystem.directory_name_cant_be_empty
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/18f53a99b55ded6d.
Report an issue: GitHub.