{"record":{"id":"2d713f809077bda4","repo":"octobercms/october","slug":"missing-configuration-for-pivot-form-in-relation","errorCode":null,"errorMessage":"Missing configuration for [pivot.form] in RelationController definition [{$this->field}].","messagePattern":"Missing configuration for \\[pivot\\.form\\] in RelationController definition \\[(.+?)\\]\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/behaviors/relationcontroller/HasPivotMode.php","lineNumber":122,"sourceCode":"    }\n\n    /**\n     * onRelationManageAddPivot adds multiple items using a single pivot form.\n     */\n    public function onRelationManageAddPivot()\n    {\n        return $this->onRelationManagePivotForm();\n    }\n\n    /**\n     * onRelationManagePivotForm\n     */\n    public function onRelationManagePivotForm()\n    {\n        $this->beforeAjax();\n\n        if (!$this->pivotWidget) {\n            throw new ApplicationException(\"Missing configuration for [pivot.form] in RelationController definition [{$this->field}].\");\n        }\n\n        $this->vars['foreignId'] = $this->foreignId ?: post('checked');\n\n        return $this->relationMakePartial('pivot_form');\n    }\n\n    /**\n     * onRelationManagePivotCreate\n     */\n    public function onRelationManagePivotCreate()\n    {\n        $this->beforeAjax();\n\n        // If the pivot model fails for some reason, abort the sync\n        Db::transaction(function () {\n            // Add the checked IDs to the pivot table\n            $foreignIds = (array) $this->foreignId;","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/behaviors/relationcontroller/HasPivotMode.php#L104-L140","documentation":"Thrown when the RelationController pivot widget has not been initialized, meaning the relation definition for the field lacks a pivot.form configuration block (the YAML config that defines the pivot model form). It fires when a pivot-mode AJAX action (add/manage pivot) is triggered but $this->pivotWidget is null because no pivot form was configured.","triggerScenarios":"Thrown at modules/backend/behaviors/relationcontroller/HasPivotMode.php:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a pivot.form section to the relation definition in the controller's config YAML, e.g. pivot: { form: ~/plugins/author/plugin/models/pivot/fields.yaml }","Provide a pivot model class via the pivot[] relation definition so the pivot form can be built","If pivot behavior is not intended, stop invoking pivot-mode handlers (onRelationManageAddPivot / pivot buttons) for this field"],"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"}