octobercms/october · error · CmsException

cms::lang.theme.active.not_found

Error message

cms::lang.theme.active.not_found

What it means

Constructor guard in the CMS Controller: no theme argument was passed and Theme::getActiveTheme() returned nothing (no active theme configured), so there is no theme to render against and construction aborts.

Solutions

  1. Set an active theme in the backend CMS settings
  2. Check the cms.activeTheme config value matches an existing theme directory
  3. Pass an explicit Theme instance to the Controller constructor
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/cms/classes/Controller.php:127 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/145928e959e17c4e. Report an issue: GitHub.

Appendix: source

Thrown at modules/cms/classes/Controller.php:127

     * @var \Cms\Classes\PartialWatcher partialWatcher, used internally.
     */
    protected $partialWatcher;

    /**
     * @var bool pageCycled
     */
    protected $pageCycled = false;

    /**
     * __construct the controller.
     * @param \Cms\Classes\Theme $theme Specifies the CMS theme.
     * If the theme is not specified, the current active theme used.
     */
    public function __construct($theme = null)
    {
        $this->theme = $theme ?: Theme::getActiveTheme();
        if (!$this->theme) {
            throw new CmsException(Lang::get('cms::lang.theme.active.not_found'));
        }

        $this->assetPath = $this->getThemeAssetRelativePath();
        $this->assetUrlPath = $this->getThemeAssetUrl();
        $this->router = new Router($this->theme);
        $this->initTwigEnvironment();

        self::$instance = $this;
    }

    /**
     * run finds and serves the requested page URL.
     * If the page cannot be found, returns the page with the URL /404.
     * If the /404 page doesn't exist, returns the system 404 page.
     * If the parameter is null, the current URL used. If it is not provided then '/' is used.
     * Returns the response to the provided URL.
     *
     * @param string|null $url

View on GitHub (pinned to b608633a7e)