{"record":{"id":"fce5d75e10b74153","repo":"octobercms/october","slug":"cms-lang-component-not-found-fce5d7","errorCode":null,"errorMessage":"cms::lang.component.not_found","messagePattern":"cms::lang\\.component\\.not_found","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/cms/classes/editorextension/HasExtensionCrud.php","lineNumber":201,"sourceCode":"         *         \\Log::info(\"A $type has been deleted\");\n         *     });\n         */\n        $this->fireSystemEvent('cms.template.delete', [$documentType]);\n    }\n\n    /**\n     * command_onExpandCmsComponent\n     */\n    protected function command_onExpandCmsComponent()\n    {\n        if (!$componentAlias = post('componentAlias')) {\n            throw new ApplicationException(trans('cms::lang.component.no_records'));\n        }\n\n        $documentData = $this->getRequestDocumentData();\n        $componentClass = $this->findComponentClassByAlias($componentAlias, $documentData);\n        if (!$componentClass) {\n            throw new ApplicationException(trans('cms::lang.component.not_found', ['name' => $componentAlias]));\n        }\n\n        $manager = ComponentManager::instance();\n        $componentObj = $manager->makeComponent($componentClass);\n        $partial = ComponentPartial::load($componentObj, 'default');\n        if (!$partial) {\n            throw new ApplicationException(__('Component does use a default partial'));\n        }\n\n        $content = $partial->getContent();\n        $content = str_replace('__SELF__', $componentAlias, $content);\n\n        return [\n            'content' => $content\n        ];\n    }\n\n    /**","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/classes/editorextension/HasExtensionCrud.php#L183-L219","documentation":"While expanding a CMS component in the editor, findComponentClassByAlias() failed to map the supplied alias to a component class using the request's documentData; the editor throws 'The component :name is not found.' It means the alias is not present in the current document's component definitions, distinct from the component class being unregistered.","triggerScenarios":"onExpandCmsComponent receives componentAlias 'foo' that is not declared in the documentData sent with the request — the component was removed from the template but a stale editor panel still references it, or the payload reflects an older revision of the document.","commonSituations":"Unsaved or rolled-back documents; two editor tabs editing the same template; custom code passing an alias that was never attached to the document.","solutions":["Save/reload the document in the editor so documentData includes the component and the alias matches","Verify the alias spelling — it must equal the alias defined in the template's components section","Confirm the component's plugin is installed so the alias can resolve to a class"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$aliases = array_keys($documentData['components'] ?? []);\nif (!in_array($componentAlias, $aliases, true)) {\n    // alias not part of this document: refresh document data or bail out\n}","typeGuard":"function aliasInDocument(alias, documentData) {\n  return Object.prototype.hasOwnProperty.call(documentData?.components ?? {}, alias);\n}","tryCatchPattern":null,"preventionTips":["Save the document before invoking per-component editor commands","Avoid concurrent tabs editing the same template; reload before expanding components","Derive the alias from the loaded document, never from memory of an earlier session"],"tags":["editor","backend","component","alias","cms"],"backgroundTag":"component-not-registered","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}