octobercms/october · warning · ApplicationException

editor::lang.filesystem.selected_files_not_found

Error message

editor::lang.filesystem.selected_files_not_found

What it means

Thrown by editorMoveFilesOrDirectories when the $selectedList ('source') array is empty (lines 163-165). Message: 'Selected files not found'. It is a pure precondition check — nothing has been touched yet — and exists because a move command with no sources is meaningless; the sidebar UI normally makes it unreachable.

Source

Thrown at modules/editor/traits/FileSystemFunctions.php:164

                    if (!@rmdir($fullPath)) {
                        throw new ApplicationException(Lang::get(
                            'editor::lang.filesystem.error_deleting_dir',
                            ['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)) {

View on GitHub (pinned to b608633a7e)

Solutions

  1. Re-select the files/folders in the sidebar and repeat the move
  2. If scripting the API, always send a non-empty 'source' array of relative paths
  3. Update the page (clear stale selection state) and try again
  4. Check your request payload actually serializes the selection (network tab: 'source' must be a JSON array)

Example fix

// before
{ "source": [], "destination": "js" }
// after
{ "source": ["css/old.css"], "destination": "js" }
Defensive patterns

Strategy: validation

Validate before calling

if (!is_array($source) || !count($source)) {
    // do not send the move command; re-select items in the sidebar
}

Prevention

When it happens

Trigger: command_onAssetMove with documentData 'source' => [] — e.g. a drag-and-drop that failed to register the selection, a stale page where the selection was cleared, or a custom API client posting an empty array (a missing key would instead fail earlier in ApiHelpers::assertGetKey).

Common situations: Custom scripts integrating with the editor endpoints; UI edge cases where a node drag starts before selection state is set; automated tests exercising the move command with placeholder payloads.

Related errors


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