octobercms/october · error · ValidationException
Invalid file extension: :invalid. Allowed extensions are…
Error message
Invalid file extension: :invalid. Allowed extensions are: :allowed.
What it means
Exception translation in throwHalcyonException: Halcyon threw InvalidExtensionException (the file name's extension is not among the datasource's allowed extensions) and it is mapped to a ValidationException naming the invalid extension.
Solutions
- Use an extension allowed for the object type (e.g. .htm for pages/partials/layouts)
- Adjust the Halcyon datasource allowed extensions list
- Fix automated file naming that drops or changes the extension
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at modules/cms/classes/CmsObject.php:320 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/fcdfdffc59f6deb5.
Report an issue: GitHub.
Appendix: source
Thrown at modules/cms/classes/CmsObject.php:320
}
//
// Internals
//
/**
* Converts an exception type thrown by Halcyon to a native CMS exception.
* @param Exception $ex
*/
protected static function throwHalcyonException(Exception $ex)
{
if ($ex instanceof \October\Rain\Halcyon\Exception\MissingFileNameException) {
throw new ValidationException([
'fileName' => Lang::get('cms::lang.cms_object.file_name_required')
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\InvalidExtensionException) {
throw new ValidationException(['fileName' =>
Lang::get('cms::lang.cms_object.invalid_file_extension', [
'allowed' => implode(', ', $ex->getAllowedExtensions()),
'invalid' => $ex->getInvalidExtension()
])
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\InvalidFileNameException) {
throw new ValidationException([
'fileName' => Lang::get('cms::lang.cms_object.invalid_file', ['name'=>$ex->getInvalidFileName()])
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\InvalidDirectoryNameException) {
throw new ValidationException([
'fileName' => Lang::get('cms::lang.cms_object.invalid_file', ['name'=>$ex->getInvalidDirectoryName()])
]);
}
elseif ($ex instanceof \October\Rain\Halcyon\Exception\FileExistsException) {
throw new ValidationException(['fileName' =>View on GitHub (pinned to b608633a7e)