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

  1. Send '/' when moving to the assets root instead of an empty string
  2. Re-do the drag-and-drop onto a visible directory node in the sidebar
  3. In custom clients, default destination to '/' when the user picks the tree root
  4. 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

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


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/18f53a99b55ded6d. Report an issue: GitHub.