{"record":{"id":"ebcb40d683d065cb","repo":"octobercms/october","slug":"inspector-title-is-a-required-string","errorCode":null,"errorMessage":"Inspector title is a required string","messagePattern":"Inspector title is a required string","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/backend/vuecomponents/inspector/assets/js/classes/host.js","lineNumber":4,"sourceCode":"export class InspectorHost {\n    showModal(title, obj, dataSchema, uniqueId, options, parentObj) {\n        if (typeof title !== 'string' || !title.length) {\n            throw new Error('Inspector title is a required string');\n        }\n\n        if (typeof obj !== 'object') {\n            throw new Error('Inspector Object must be an object');\n        }\n\n        if (parentObj !== undefined && typeof parentObj !== 'object') {\n            throw new Error('Inspector Parent Object must be an object');\n        }\n\n        if (!Array.isArray(dataSchema)) {\n            throw new Error('Inspector data schema must be an array');\n        }\n\n        if (typeof uniqueId !== 'string' || !uniqueId.length) {\n            throw new Error('Inspector unique key is a required string');\n        }\n","sourceCodeStart":1,"sourceCodeEnd":22,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/vuecomponents/inspector/assets/js/classes/host.js#L1-L22","documentation":"InspectorHost.showModal() opens the Inspector modal and validates every argument up front; the first check requires a non-empty string `title`, which becomes the modal heading. A missing, non-string, or empty title throws synchronously before any UI is mounted — a nameless modal is always a caller bug, not a runtime condition.","triggerScenarios":"Calling showModal(undefined, obj, schema, id) or showModal('', obj, schema, id) — e.g. a config-driven title key that is absent, a translation key that resolved to empty, or arguments passed in the wrong order.","commonSituations":"Custom plugin JavaScript opening the inspector modal programmatically; refactoring from an inline inspector (where the title lives in the schema) to showModal and forgetting the now-explicit title argument; data-driven UIs where the title element is optional.","solutions":["Pass a non-empty string as the first argument.","Default computed titles: showModal(title || 'Properties', ...).","If the title comes from localization, fix or fall back for the missing translation key."],"exampleFix":"// before\nhost.showModal(this.config.title, obj, schema, uniqueId);\n\n// after\nhost.showModal(this.config.title || 'Properties', obj, schema, uniqueId);","handlingStrategy":"validation","validationCode":"const modalTitle = typeof title === 'string' && title.length ? title : 'Properties';\nhost.showModal(modalTitle, obj, schema, uniqueId);","typeGuard":"function isInspectorTitle(value) {\n    return typeof value === 'string' && value.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Default computed/config titles with a visible fallback","Keep showModal call sites in one helper so argument rules are checked once"],"tags":["inspector","argument-validation","modal","vue"],"backgroundTag":"invalid-argument-type","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}