{"record":{"id":"14cf92e5650bf788","repo":"octobercms/october","slug":"object-list-value-should-be-an-array-property","errorCode":null,"errorMessage":"Object list value should be an array. Property: ${this.propertyDefinition.property}","messagePattern":"Object list value should be an array\\. Property: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"modules/backend/assets/foundation/controls/inspector/inspector.editor.objectlist.js","lineNumber":94,"sourceCode":"        }\n\n        if (value === undefined) {\n            var placeholder = this.propertyDefinition.placeholder\n\n            if (placeholder !== undefined) {\n                $.oc.foundation.element.addClass(link, 'cell-placeholder')\n                link.textContent = placeholder\n            }\n            else {\n                link.textContent = 'Items: 0'\n            }\n        }\n        else {\n            var itemCount = 0\n\n            if (!this.isKeyValueMode()) {\n                if (value.length === undefined) {\n                    throw new Error('Object list value should be an array. Property: ' + this.propertyDefinition.property)\n                }\n\n                itemCount = value.length\n            }\n            else {\n                if (typeof value !== 'object') {\n                    throw new Error('Object list value should be an object. Property: ' + this.propertyDefinition.property)\n                }\n\n                itemCount = this.getValueKeys(value).length\n            }\n\n            $.oc.foundation.element.removeClass(link, 'cell-placeholder')\n            link.textContent = 'Items: ' + itemCount\n        }\n    }\n\n    ObjectListEditor.prototype.getPopupContent = function() {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/assets/foundation/controls/inspector/inspector.editor.objectlist.js#L76-L112","documentation":"When the lookup type is 'url', PageLookupItem::isValidUrl must accept the submitted `url` value (it accepts strings starting with '#', '/', 'http://', 'https://', or mailto/tel/sms:, and otherwise falls back to PHP's FILTER_VALIDATE_URL). Missing `url` or an unparseable value throws this ValidationException — note it is attached to the `reference` field, so the popup highlights reference rather than the URL input.","triggerScenarios":"Submitting type 'url' with `PageLookupItem[url]` absent, empty, or scheme-less like 'example.com/about' (no leading '/', no http://). Typing 'mailto:' alone without an address also fails the regex and the filter.","commonSituations":"Users typing bare domain names without a scheme; forgetting that relative URLs must start with '/'; programmatic inserts that pass only type and reference for URL links.","solutions":["Enter a full URL: `https://example.com/about`, or a root-relative path `/about`, or an anchor `#section`.","For email/phone links use the recognized schemes: `mailto:me@example.com`, `tel:+15551234`.","If the popup inserts programmatically, set `PageLookupItem.url` to a value starting with '/', '#', or http(s)://."],"exampleFix":"// before\noc.request(el, 'pagelookup::onInsertReference', {\n    data: { PageLookupItem: { type: 'url', url: 'example.com/about' } }\n});\n\n// after\noc.request(el, 'pagelookup::onInsertReference', {\n    data: { PageLookupItem: { type: 'url', url: 'https://example.com/about' } }\n});","handlingStrategy":"validation","validationCode":"// Mirror of PageLookupItem::isValidUrl (modules/cms/models/PageLookupItem.php:604)\nfunction isValidLinkUrl(path) {\n    return /^(#|\\/|https?:\\/\\/|(mailto|tel|sms):)/.test(path);\n}","typeGuard":null,"tryCatchPattern":"try {\n    $widget->onInsertReference();\n} catch (ValidationException $e) {\n    if (isset($e->getErrors()['reference'])) {\n        // URL rejected — prompt for scheme or leading slash\n    }\n}","preventionTips":["Normalize URL input client-side: prefix 'https://' when the value has no scheme and does not start with / or #.","Accept only '/', '#', http(s)://, mailto:, tel:, sms: prefixed values.","Remember the error is reported on the reference field, not a url field."],"tags":["october-cms","backend-widget","pagelookup","url-validation","form-validation"],"backgroundTag":"url-validation-failed","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}