{"record":{"id":"3f64e3c98c4fc578","repo":"octobercms/october","slug":"unable-to-find-the-active-theme","errorCode":null,"errorMessage":"Unable to find the active theme.","messagePattern":"Unable to find the active theme\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/cms/models/MaintenanceSetting.php","lineNumber":91,"sourceCode":"    {\n        if (!System::hasDatabase()) {\n            return false;\n        }\n\n        if (BackendAuth::userHasAccess('general.backend.view_offline')) {\n            return false;\n        }\n\n        return self::get('is_enabled', false);\n    }\n\n    /**\n     * getCmsPageOptions\n     */\n    public function getCmsPageOptions()\n    {\n        if (!$theme = $this->findTargetTheme()) {\n            throw new ApplicationException('Unable to find the active theme.');\n        }\n\n        return array_map(function($code) use ($theme) {\n            return \"{$theme->getDirName()}/{$code}\";\n        }, Page::listInTheme($theme)->lists('fileName', 'fileName'));\n    }\n\n    /**\n     * beforeValidate ensures each theme has its own CMS page, store it inside a mapping array.\n     */\n    public function beforeValidate()\n    {\n        if (!$theme = $this->findTargetTheme()) {\n            throw new ApplicationException('Unable to find the active theme.');\n        }\n\n        $themeMap = (array) $this->theme_map;\n        $themeMap[$theme->getDirName()] = $this->cms_page;","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/models/MaintenanceSetting.php#L73-L109","documentation":"Thrown by getCmsPageOptions when findTargetTheme() returns null, i.e. no active theme can be resolved for the current request/backend context. The dropdown options for CMS pages cannot be built without a theme directory to prefix page codes with.","triggerScenarios":"Thrown at modules/cms/models/MaintenanceSetting.php:91 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure an active theme is configured (Theme settings or cms.activeTheme config) and its directory exists","Clear cached theme resolution if the theme was recently renamed","Check that the CMS module is loaded before using theme-dependent features"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}