{"record":{"id":"bc8a2544ca68e25b","repo":"octobercms/october","slug":"please-specify-a-name-for-the-theme","errorCode":null,"errorMessage":"Please specify a name for the theme.","messagePattern":"Please specify a name for the theme\\.","errorType":"validation","errorClass":"ValidationException","httpStatus":null,"severity":"error","filePath":"modules/cms/controllers/Themes.php","lineNumber":200,"sourceCode":"\n    /**\n     * index_onCreate\n     */\n    public function index_onCreate()\n    {\n        if (!BackendAuth::userHasAccess('cms.themes.create')) {\n            throw new ForbiddenException;\n        }\n\n        $widget = $this->makeCreateFormWidget();\n        $data = $widget->getSaveData();\n        $newDirName = trim($data['dir_name'] ?? '');\n        $destinationPath = themes_path().'/'.$newDirName;\n\n        $data = array_except($data, 'dir_name');\n\n        if (!strlen(trim($data['name'] ?? ''))) {\n            throw new ValidationException(['name' => __('Please specify a name for the theme.')]);\n        }\n\n        if (!preg_match('/^[a-z0-9\\_\\-]+$/i', $newDirName)) {\n            throw new ValidationException(['dir_name' => __('Name can contain only digits, Latin letters and the following symbols: _-')]);\n        }\n\n        if (File::isDirectory($destinationPath)) {\n            throw new ValidationException(['dir_name' => __('Desired theme directory already exists.')]);\n        }\n\n        File::makeDirectory($destinationPath);\n        File::makeDirectory($destinationPath.'/assets');\n        File::makeDirectory($destinationPath.'/content');\n        File::makeDirectory($destinationPath.'/layouts');\n        File::makeDirectory($destinationPath.'/pages');\n        File::makeDirectory($destinationPath.'/partials');\n        File::put($destinationPath.'/theme.yaml', '');\n","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/controllers/Themes.php#L182-L218","documentation":"Error \"Please specify a name for the theme.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/controllers/Themes.php:200 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}