{"record":{"id":"172488c86bc53caa","repo":"octobercms/october","slug":"the-model-must-implement-the-nestedtree-or-sortabl","errorCode":null,"errorMessage":"The model must implement the NestedTree or Sortable traits.","messagePattern":"The model must implement the NestedTree or Sortable traits\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/behaviors/ReorderController.php","lineNumber":218,"sourceCode":"    }\n\n    /**\n     * validateModel validates the supplied form model.\n     */\n    protected function validateModel()\n    {\n        $model = $this->controller->reorderGetModel();\n        $modelTraits = class_uses($model);\n\n        if (isset($modelTraits[\\October\\Rain\\Database\\Traits\\Sortable::class])) {\n            $this->sortMode = 'simple';\n        }\n        elseif (isset($modelTraits[\\October\\Rain\\Database\\Traits\\NestedTree::class])) {\n            $this->sortMode = 'nested';\n            $this->showTree = true;\n        }\n        else {\n            throw new ApplicationException('The model must implement the NestedTree or Sortable traits.');\n        }\n\n        return $model;\n    }\n\n    /**\n     * Returns all the records from the supplied model.\n     * @return Collection\n     */\n    protected function getRecords()\n    {\n        $records = null;\n        $model = $this->controller->reorderGetModel();\n        $query = $model->newQuery();\n\n        $this->controller->reorderExtendQuery($query);\n\n        if ($this->sortMode == 'simple') {","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/behaviors/ReorderController.php#L200-L236","documentation":"Error \"The model must implement the NestedTree or Sortable traits.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/behaviors/ReorderController.php:218 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"}