{"record":{"id":"41b8b2b7e6344a24","repo":"octobercms/october","slug":"key-property-keyproperty-value-should-be-a-st","errorCode":null,"errorMessage":"Key property (${keyProperty}) value should be a string. Property: ${this.propertyDefinition.property}","messagePattern":"Key property \\((.+?)\\) value should be a string\\. Property: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/backend/assets/foundation/controls/inspector/inspector.editor.objectlist.js","lineNumber":489,"sourceCode":"            return true\n        }\n\n        if (this.currentRowInspector === null) {\n            return true\n        }\n\n        var data = this.currentRowInspector.getValues(),\n            keyProperty = this.propertyDefinition.keyProperty\n\n        if (data[keyProperty] === undefined) {\n            throw new Error('Key property ' + keyProperty + ' is not found in the Inspector data. Property: ' + this.propertyDefinition.property)\n        }\n\n        var keyPropertyValue = data[keyProperty],\n            keyPropertyTitle = this.getKeyProperty().title\n\n        if (typeof keyPropertyValue !== 'string') {\n            throw new Error('Key property (' + keyProperty + ') value should be a string. Property: ' + this.propertyDefinition.property)\n        }\n\n        if ($.trim(keyPropertyValue).length === 0) {\n            $.oc.flashMsg({text: 'The value of key property ' + keyPropertyTitle + ' cannot be empty.', 'class': 'error', 'interval': 3})\n            return false\n        }\n\n        var selectedRow = this.getSelectedRow(),\n            tbody = this.getTableBody(),\n            dataRows = tbody.querySelectorAll('tr[data-inspector-values]')\n\n        for (var i = 0, len = dataRows.length; i < len; i++) {\n            var dataRow = dataRows[i],\n                rowData = JSON.parse(dataRow.getAttribute('data-inspector-values'))\n\n            if (selectedRow == dataRow) {\n                continue\n            }","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/assets/foundation/controls/inspector/inspector.editor.objectlist.js#L471-L507","documentation":"Once a definition name is known, initDash verifies it against the controller's dash configuration (from `dashGetConfig()`, typically `config_dash.yaml` or the `$dashConfig` array) using dashHasDefinition, which checks whether the config object has a top-level property named after the definition. If that key does not exist, this ApplicationException is thrown with the requested definition name substituted for :field.","triggerScenarios":"Calling `dashRender('reports')` when the YAML only defines `main:`; posting `_dash_definition=oldname` after a config refactor renamed the key; typos or case differences between the render call and the config key.","commonSituations":"Renaming definitions in config_dash.yaml without updating views and AJAX payloads; adding a second dashboard to the config and misspelling the key; environments where the YAML file differs (config file not deployed).","solutions":["Add the definition as a top-level key in your dash config, e.g. in config_dash.yaml: `reports:` followed by its properties.","Or correct the name at the call site to match an existing key (watch spelling and case).","For dynamic dashboards, register the definition at runtime with `$this->dashRegisterDefinition('reports', [...])` before rendering."],"exampleFix":"# config/config_dash.yaml\n# before\nmain:\n  widgets: [...]\n\n# after (dashRender('reports') was requested)\nmain:\n  widgets: [...]\nreports:\n  widgets: [...]","handlingStrategy":"validation","validationCode":"// Validate the definition against the config before using it\n$definition = post(\\Dashboard\\Behaviors\\DashController::PARAM_DEFINITION) ?: 'main';\nif (!$this->dashHasDefinition($definition)) { // public helper on the behavior\n    throw new NotFoundException('Unknown dashboard: '.$definition);\n}\nreturn $this->dashRender($definition);","typeGuard":null,"tryCatchPattern":"try {\n    $this->dashRender($name);\n} catch (ApplicationException $e) {\n    if (str_contains($e->getMessage(), 'does not contain a definition')) {\n        // the name is valid syntax but absent from config — add the YAML key or fix the name\n    }\n}","preventionTips":["Keep definition keys in config_dash.yaml and dashRender() calls in sync — one review checklist item per rename.","Use dashHasDefinition($name) to validate names coming from user input or query params.","For runtime dashboards, register them with dashRegisterDefinition() before the first render."],"tags":["october-cms","dashboard","dash-controller","configuration","yaml"],"backgroundTag":"missing-configuration","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}