octobercms/october · error · ApplicationException

cms::lang.theme.edit.not_match

Error message

cms::lang.theme.edit.not_match

What it means

Theme-consistency guard in validateRequestTheme: the theme in the request being saved does not match the currently selected edit theme (cms::lang.theme.edit.not_match), preventing writes to a theme the editor session no longer has open.

Solutions

  1. Reload the editor so the request carries the currently selected theme
  2. Ensure the theme switcher state and the document save request agree
  3. Avoid changing the edit theme while documents are open in tabs
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/cms/classes/editorextension/HasExtensionCrud.php:562 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/4004c542c116cf65. Report an issue: GitHub.

Appendix: source

Thrown at modules/cms/classes/editorextension/HasExtensionCrud.php:562

         *
         *     Event::listen('cms.template.processSettingsBeforeSave', function ((\Cms\Classes\EditorExtension) $editorExtension, (object) $dataHolder) {
         *         // Make some modifications to the $dataHolder object
         *     });
         */
        $dataHolder = (object) ['settings' => $settings, 'documentType' => $documentType];
        $this->fireSystemEvent('cms.template.processSettingsBeforeSave', [$dataHolder]);

        return $dataHolder->settings;
    }

    /**
     * validateRequestTheme validates that the current request is within the active theme
     * @return void
     */
    private function validateRequestTheme($metadata)
    {
        if ($this->getTheme()->getDirName() != $metadata['theme']) {
            throw new ApplicationException(trans('cms::lang.theme.edit.not_match'));
        }
    }

    /**
     * handleLineEndings
     */
    protected function handleLineEndings($templateData)
    {
        $convertLineEndings = Config::get('system.convert_line_endings', false) === true;
        if (!$convertLineEndings) {
            return $templateData;
        }

        if (!empty($templateData['markup'])) {
            $templateData['markup'] = $this->convertLineEndings($templateData['markup']);
        }

        if (!empty($templateData['code'])) {

View on GitHub (pinned to b608633a7e)