{"record":{"id":"9f7d1f719aabb219","repo":"octobercms/october","slug":"unable-to-add-navigation-items-before-they-are-loa","errorCode":null,"errorMessage":"Unable to add navigation items before they are loaded.","messagePattern":"Unable to add navigation items before they are loaded\\.","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/backend/classes/NavigationManager.php","lineNumber":214,"sourceCode":"     * @param array  $definitions\n     */\n    public function addMainMenuItems($owner, array $definitions)\n    {\n        foreach ($definitions as $code => $definition) {\n            $this->addMainMenuItem($owner, $code, $definition);\n        }\n    }\n\n    /**\n     * addMainMenuItem dynamically adds a single main menu item.\n     * @param string $owner\n     * @param string $code\n     * @param array  $definition\n     */\n    public function addMainMenuItem($owner, $code, array $definition)\n    {\n        if ($this->items === null) {\n            throw new SystemException('Unable to add navigation items before they are loaded.');\n        }\n\n        $itemKey = $this->makeItemKey($owner, $code);\n\n        if (isset($this->items[$itemKey])) {\n            $definition = array_merge(\n                $this->items[$itemKey]->toArray(),\n                $definition\n            );\n        }\n\n        $item = array_merge($definition, [\n            'code'  => $code,\n            'owner' => $owner\n        ]);\n\n        $sideMenu = array_pull($item, 'sideMenu');\n","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/classes/NavigationManager.php#L196-L232","documentation":"Error \"Unable to add navigation items before they are loaded.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/classes/NavigationManager.php:214 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"}