{"record":{"id":"e58fdb725905712b","repo":"octobercms/october","slug":"cms-sort-pages-command-excepts-a-parameter-comm","errorCode":null,"errorMessage":"cms:sort-pages command excepts a parameter: ${commandObj.fullCommand}","messagePattern":"cms:sort-pages command excepts a parameter: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/cms/assets/js/cms.editor.extension.documentcontroller.page.js","lineNumber":41,"sourceCode":"\n        knownSortingModes.forEach((item) => {\n            const itemValue = localStorage.getItem(item);\n            if (itemValue !== null) {\n                this.emit(itemValue);\n            }\n        });\n    }\n\n    initListeners() {\n        this.on('cms:sort-pages@title, cms:sort-pages@url, cms:sort-pages@filename', this.sortPages);\n        this.on('cms:group-pages@path, cms:group-pages@url', this.groupPages);\n        this.on('cms:display-pages@title, cms:display-pages@url, cms:display-pages@filename', this.setDisplayMode);\n        this.on('cms:navigator-nodes-updated', this.onNavigatorNodesUpdated);\n    }\n\n    sortPages(commandObj) {\n        if (!commandObj.hasParameter) {\n            throw new Error(`cms:sort-pages command excepts a parameter: ${commandObj.fullCommand}`);\n        }\n\n        const pagesNode = this.rootNavigatorNodeSafe;\n        if (!pagesNode) {\n            return;\n        }\n\n        const sortingItem = menuUtils.findMenuItem(pagesNode.topLevelMenuitems, ['sorting'], 'command');\n\n        menuUtils.checkItemInGroup(sortingItem.items, commandObj.fullCommand);\n        pagesNode.sortBy = commandObj.parameter;\n\n        localStorage.setItem('cms-pages-sort-cmd', commandObj.fullCommand);\n    }\n\n    setDisplayMode(commandObj) {\n        if (!commandObj.hasParameter) {\n            throw new Error(`cms:display-pages command excepts a parameter: ${commandObj.fullCommand}`);","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/assets/js/cms.editor.extension.documentcontroller.page.js#L23-L59","documentation":"Command-contract guard in sortPages: the 'cms:sort-pages' handler expects a parameter suffix (e.g. cms:sort-pages@title) but received a command object without one. The navigator menu emitted a command that does not match the registered parameterized format.","triggerScenarios":"Thrown at modules/cms/assets/js/cms.editor.extension.documentcontroller.page.js:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Emit the command with a parameter, e.g. cms:sort-pages@title or @url","Fix the navigator menu item definition to include the parameter","Update the listener registration if the command format changed"],"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"}