{"record":{"id":"5dfbed35e5a87197","repo":"octobercms/october","slug":"object-list-key-property-this-propertydefinition","errorCode":null,"errorMessage":"Object list key property ${this.propertyDefinition.keyProperty} is not defined in itemProperties. Property: ${this.propertyDefinition.property}","messagePattern":"Object list key property (.+?) is not defined in itemProperties\\. Property: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"modules/backend/assets/foundation/controls/inspector/inspector.editor.objectlist.js","lineNumber":32,"sourceCode":"            throw new Error('The titleProperty property should be specified in the objectList editor configuration. Property: ' + propertyDefinition.property)\n        }\n\n        if (propertyDefinition.itemProperties === undefined) {\n            throw new Error('The itemProperties property should be specified in the objectList editor configuration. Property: ' + propertyDefinition.property)\n        }\n\n        Base.call(this, inspector, propertyDefinition, containerCell, group)\n    }\n\n    ObjectListEditor.prototype = Object.create(BaseProto)\n    ObjectListEditor.prototype.constructor = Base\n\n    ObjectListEditor.prototype.init = function() {\n        if (this.isKeyValueMode()) {\n            var keyProperty = this.getKeyProperty()\n\n            if (!keyProperty) {\n                throw new Error('Object list key property ' + this.propertyDefinition.keyProperty\n                    + ' is not defined in itemProperties. Property: ' + this.propertyDefinition.property)\n            }\n        }\n\n        BaseProto.init.call(this)\n    }\n\n    ObjectListEditor.prototype.dispose = function() {\n        this.unregisterHandlers()\n        this.removeControls()\n\n        this.currentRowInspector = null\n        this.popup = null\n\n        BaseProto.dispose.call(this)\n    }\n\n    ObjectListEditor.prototype.supportsExternalParameterEditor = function() {","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/assets/foundation/controls/inspector/inspector.editor.objectlist.js#L14-L50","documentation":"The third PageLookup validation: when the `reference` form field is neither hidden nor disabled and the submitted reference value is empty, this ValidationException is thrown against `reference`. The reference names the exact target within the chosen type (a specific page, blog post, record, etc.), so an empty one cannot resolve at render time.","triggerScenarios":"Submitting the popup with the reference select empty while the field is editable; posting `PageLookupItem` data with `reference` missing or ''; disabling options that leave no selectable reference for the current type.","commonSituations":"Clicking insert before picking the target item; a type whose reference options failed to load (empty dropdown); tests submitting partial payloads.","solutions":["Choose a value in the reference dropdown (the page/post/record to link to) before inserting.","If a type has no reference target, hide or disable the field in the widget configuration so the check is bypassed.","Programmatic callers: include `reference` in the payload, e.g. `{ type: 'cms-page', reference: 'blog/post/1' }`."],"exampleFix":"// before\noc.request(el, 'pagelookup::onInsertReference', {\n    data: { PageLookupItem: { type: 'cms-page', cms_page: 'about/index' } }\n});\n\n// after\noc.request(el, 'pagelookup::onInsertReference', {\n    data: { PageLookupItem: { type: 'cms-page', cms_page: 'about/index', reference: 'about/team' } }\n});","handlingStrategy":"validation","validationCode":"const item = { ...payload.PageLookupItem };\nif (!item.reference && referenceFieldEnabled) {\n    showFlash('Please select a page reference.');\n} else {\n    oc.request(el, 'pagelookup::onInsertReference', { data: { PageLookupItem: item } });\n}","typeGuard":null,"tryCatchPattern":"try {\n    $result = $widget->onInsertReference();\n} catch (October\\Rain\\Exception\\ValidationException $e) {\n    $errors = $e->getErrors(); // ['reference' => 'Please select a page reference']\n}","preventionTips":["Require a reference selection before enabling insert.","If a type has no reference, hide or disable the reference field in the widget config so the check is skipped.","Watch for empty reference dropdowns — they usually mean options failed to load."],"tags":["october-cms","backend-widget","pagelookup","form-validation","ajax"],"backgroundTag":"form-validation-failed","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}