{"record":{"id":"4004c542c116cf65","repo":"octobercms/october","slug":"cms-lang-theme-edit-not-match","errorCode":null,"errorMessage":"cms::lang.theme.edit.not_match","messagePattern":"cms::lang\\.theme\\.edit\\.not_match","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/cms/classes/editorextension/HasExtensionCrud.php","lineNumber":562,"sourceCode":"         *\n         *     Event::listen('cms.template.processSettingsBeforeSave', function ((\\Cms\\Classes\\EditorExtension) $editorExtension, (object) $dataHolder) {\n         *         // Make some modifications to the $dataHolder object\n         *     });\n         */\n        $dataHolder = (object) ['settings' => $settings, 'documentType' => $documentType];\n        $this->fireSystemEvent('cms.template.processSettingsBeforeSave', [$dataHolder]);\n\n        return $dataHolder->settings;\n    }\n\n    /**\n     * validateRequestTheme validates that the current request is within the active theme\n     * @return void\n     */\n    private function validateRequestTheme($metadata)\n    {\n        if ($this->getTheme()->getDirName() != $metadata['theme']) {\n            throw new ApplicationException(trans('cms::lang.theme.edit.not_match'));\n        }\n    }\n\n    /**\n     * handleLineEndings\n     */\n    protected function handleLineEndings($templateData)\n    {\n        $convertLineEndings = Config::get('system.convert_line_endings', false) === true;\n        if (!$convertLineEndings) {\n            return $templateData;\n        }\n\n        if (!empty($templateData['markup'])) {\n            $templateData['markup'] = $this->convertLineEndings($templateData['markup']);\n        }\n\n        if (!empty($templateData['code'])) {","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/classes/editorextension/HasExtensionCrud.php#L544-L580","documentation":"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.","triggerScenarios":"Thrown at modules/cms/classes/editorextension/HasExtensionCrud.php:562 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reload the editor so the request carries the currently selected theme","Ensure the theme switcher state and the document save request agree","Avoid changing the edit theme while documents are open in tabs"],"exampleFix":null,"handlingStrategy":"validation","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"}