{"record":{"id":"12c326a11788d12f","repo":"octobercms/october","slug":"editor-lang-filesystem-type-not-allowed","errorCode":null,"errorMessage":"editor::lang.filesystem.type_not_allowed","messagePattern":"editor::lang\\.filesystem\\.type_not_allowed","errorType":"validation","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/editor/traits/FileSystemFunctions.php","lineNumber":84,"sourceCode":"            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'));\n        }\n\n        if (!is_dir($originalFullPath) && !$this->validateFileSystemFileExtension($newName, $allowedFileExtensions)) {\n            throw new ApplicationException(Lang::get(\n                'editor::lang.filesystem.type_not_allowed',\n                ['allowed_types' => implode(', ', $allowedFileExtensions)]\n            ));\n        }\n\n        // Block renaming to a .svg target\n        if (\n            !is_dir($originalFullPath) &&\n            Config::get('media.clean_vectors', true) &&\n            strtolower(File::extension($newName)) === 'svg' &&\n            strtolower(File::extension($originalPath)) !== 'svg'\n        ) {\n            throw new ApplicationException(Lang::get(\n                'editor::lang.filesystem.type_not_allowed',\n                ['allowed_types' => implode(', ', array_diff($allowedFileExtensions, ['svg']))]\n            ));\n        }\n","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/editor/traits/FileSystemFunctions.php#L66-L102","documentation":"Thrown by editorRenameFileOrDirectory when renaming a FILE (directories are exempt) whose new extension is not in $allowedFileExtensions (line 84). For theme assets the list is FileDefinitions::get('asset_extensions') with less/sass/scss removed when safe mode is on. The message interpolates the allowed list: 'Only the following file types are allowed: :allowed_types'.","triggerScenarios":"command_onAssetRename where 'name' changes the extension to a type outside the asset list, e.g. 'notes.txt', 'data.xml', or dropping the extension entirely; or renaming 'theme.less' to anything while System::checkSafeMode() is true, because getSafeAssetExtensions() strips less/sass/scss in safe mode.","commonSituations":"Trying to 'convert' an asset by changing its extension in the rename dialog; safe_mode enabled in config/cms.php hiding preprocessor extensions; a customized 'asset_extensions' definition in config/cms.php or a plugin that no longer includes the type you want.","solutions":["Keep the file's existing extension, or rename to one of the types listed in the error message","If the type is genuinely needed, add it to 'asset_extensions' in config/cms.php (it merges with FileDefinitions::get)","If safe mode stripped less/sass/scss, disable safe_mode (dev only) or rename to a non-preprocessor extension","Create the new file with the wanted extension via upload (onAssetUpload validates the same list) instead of renaming"],"exampleFix":"// config/cms.php\n// before\n'asset_extensions' => FileDefinitions::get('asset_extensions'),\n\n// after — allow xml assets\n'asset_extensions' => array_merge(FileDefinitions::get('asset_extensions'), ['xml']),","handlingStrategy":"validation","validationCode":"$allowed = FileDefinitions::get('asset_extensions');\nif (System::checkSafeMode()) {\n    $allowed = array_diff($allowed, ['less', 'sass', 'scss']);\n}\n$newExt = strtolower(pathinfo($newName, PATHINFO_EXTENSION));\nif (!in_array($newExt, $allowed, true)) {\n    // pick a name with an allowed extension before sending the command\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the original extension when renaming; change file type via upload, not rename","Know your effective list: config/cms.php asset_extensions, minus less/sass/scss under safe mode","Show the allowed list in custom UIs before the user submits a new name"],"tags":["filesystem","file-extension","validation","editor","winter-cms"],"backgroundTag":"file-extension-not-allowed","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}