octobercms/october · error · ApplicationException
cms::lang.theme.active.is_locked
Error message
cms::lang.theme.active.is_locked
What it means
ApplicationException thrown by `Theme::getActiveTheme()` when the resolved active theme is locked: its directory contains a `.themelock` file (`isLocked()`). Locked themes are treated as non-production templates (the framework's demo themes ship locked), so the CMS refuses to use them for front-end rendering even though the theme itself is valid.
Source
Thrown at modules/cms/classes/Theme.php:212
throw new SystemException(Lang::get('cms::lang.theme.active.not_set'));
}
return $activeTheme;
}
/**
* getActiveTheme returns the active theme object
*/
public static function getActiveTheme(): ?Theme
{
if (self::$activeThemeCache !== false) {
return self::$activeThemeCache;
}
$theme = static::load($themeCode = static::getActiveThemeCode());
if ($theme->isLocked()) {
throw new ApplicationException(Lang::get('cms::lang.theme.active.is_locked', ['theme' => $themeCode]));
}
if (!$theme->isValid()) {
return self::$activeThemeCache = null;
}
return self::$activeThemeCache = $theme;
}
/**
* setActiveTheme sets the active theme
*
* The active theme code is stored in the database and overrides the
* configuration cms.active_theme config item.
*/
public static function setActiveTheme(string $code)
{
$theme = static::load($code);View on GitHub (pinned to b608633a7e)
Solutions
- Switch the active theme to a real, unlocked theme via config or the backend theme picker.
- If the theme is genuinely yours, delete the `.themelock` file from its root: `rm themes/<theme>/.themelock`.
- Audit copied/starter themes for a stray .themelock before deploying.
Example fix
# before — demo theme locked, cannot be active $ ls themes/demo-theme/.themelock themes/demo-theme/.themelock # after — only if you intend to use it as your production theme rm themes/demo-theme/.themelock # otherwise pick another theme in the backend
Defensive patterns
Strategy: validation
Validate before calling
use Cms\Classes\Theme;
$theme = Theme::load($code);
if ($theme->isLocked()) {
// refuse before rendering: locked themes are demo-only
abort(500, "Theme '{$code}' is locked and cannot be used as the active theme.");
}
$theme = Theme::getActiveTheme(); Try / catch
try {
$theme = Theme::getActiveTheme();
} catch (ApplicationException $e) {
// locked active theme — page can't render; show maintenance and alert ops
Log::critical('Active theme is locked');
return response()->view('errors.maintenance', [], 503);
} Prevention
- Check for .themelock before promoting any demo/starter theme to active.
- Keep .themelock out of custom themes (review starter-kit copies).
- Automate a pre-deploy assertion: active theme code must exist and not be locked.
When it happens
Trigger: Configuring a demo theme (one that ships `themes/<demo>/.themelock`) as cms.active_theme, or its code being stored on the site record; then requesting any front-end page.
Common situations: Enabling the framework demo theme on production to 'quickly show something'; copying a demo theme as a starter without removing the lock file; theme lock file accidentally committed into a custom theme.
Related errors
- cms::lang.layout.not_found_name
- cms::lang.theme.edit.not_found
- cms::lang.theme.active.not_set
- cms::lang.theme.edit.not_set
- Values not found for the selected row.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/4962d38b5509af8e.
Report an issue: GitHub.