{"record":{"id":"c0452d943ab76e0f","repo":"octobercms/october","slug":"safe-mode-is-currently-enabled-that-prevents-php-c-c0452d","errorCode":null,"errorMessage":"Safe mode is currently enabled that prevents PHP code changes.","messagePattern":"Safe mode is currently enabled that prevents PHP code changes\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/cms/controllers/Themes.php","lineNumber":356,"sourceCode":"\n        return $this->makeWidget(\\Backend\\Widgets\\Form::class, $widgetConfig);\n    }\n\n    //\n    // Theme import\n    //\n\n    /**\n     * index_onLoadImportForm\n     */\n    public function index_onLoadImportForm()\n    {\n        if (!BackendAuth::userHasAccess('cms.themes.create')) {\n            throw new ForbiddenException;\n        }\n\n        if (System::checkSafeMode()) {\n            throw new ApplicationException(Lang::get('cms::lang.cms_object.safe_mode_enabled'));\n        }\n\n        $theme = $this->findThemeObject();\n        $this->vars['widget'] = $this->makeImportFormWidget($theme);\n        $this->vars['themeDir'] = $theme->getDirName();\n\n        return $this->makePartial('theme_import_form');\n    }\n\n    /**\n     * index_onImport\n     */\n    public function index_onImport()\n    {\n        if (!BackendAuth::userHasAccess('cms.themes.create')) {\n            throw new ForbiddenException;\n        }\n","sourceCodeStart":338,"sourceCodeEnd":374,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/controllers/Themes.php#L338-L374","documentation":"Error \"Safe mode is currently enabled that prevents PHP code changes.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/controllers/Themes.php:356 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"}