{"record":{"id":"6cb1d48272599741","repo":"octobercms/october","slug":"backend-lang-relation-missing-definition","errorCode":null,"errorMessage":"backend::lang.relation.missing_definition","messagePattern":"backend::lang\\.relation\\.missing_definition","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/behaviors/RelationController.php","lineNumber":246,"sourceCode":"        $this->addJs('js/october.relation.js');\n        $this->addCss('css/relation.css');\n    }\n\n    /**\n     * validateField validates the supplied field and initializes the relation manager.\n     * @param string $field The relationship field.\n     * @return string The active field name.\n     */\n    protected function validateField($field = null)\n    {\n        $field = $field ?: post(self::PARAM_FIELD);\n\n        if ($field && $field !== $this->field) {\n            $this->initRelation($this->model, $field);\n        }\n\n        if (!$field && !$this->field) {\n            throw new ApplicationException(Lang::get('backend::lang.relation.missing_definition', compact('field')));\n        }\n\n        return $field ?: $this->field;\n    }\n\n    /**\n     * prepareVars for display\n     */\n    public function prepareVars()\n    {\n        $this->vars['relationLabel'] = $this->config->label ?: $this->field;\n        $this->vars['relationField'] = $this->field;\n        $this->vars['relationPopupSize'] = $this->popupSize;\n        $this->vars['relationReadOnly'] = $this->readOnly;\n        $this->vars['relationType'] = $this->relationType;\n        $this->vars['relationSearchWidget'] = $this->searchWidget;\n        $this->vars['relationToolbarWidget'] = $this->toolbarWidget;\n        $this->vars['relationToolbarButtons'] = $this->toolbarButtons;","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/behaviors/RelationController.php#L228-L264","documentation":"Error \"backend::lang.relation.missing_definition\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/behaviors/RelationController.php:246 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}