{"record":{"id":"24f9108771410e95","repo":"octobercms/october","slug":"cannot-find-th-element-for-the-inspector-row","errorCode":null,"errorMessage":"Cannot find TH element for the Inspector row","messagePattern":"Cannot find TH element for the Inspector row","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/backend/assets/foundation/controls/inspector/inspector.surface.js","lineNumber":405,"sourceCode":"            row.setAttribute('data-group-index', this.getGroupManager().getGroupIndex(group))\n            row.setAttribute('data-parent-group-index', this.getGroupManager().getGroupIndex(group.parentGroup))\n        }\n        else {\n            if (group.parentGroup) {\n                row.setAttribute('data-parent-group-index', this.getGroupManager().getGroupIndex(group))\n            }\n        }\n    }\n\n    Surface.prototype.applyGroupLevelToRow = function(row, group) {\n        if (row.hasAttribute('data-group-level')) {\n            return;\n        }\n\n        var th = this.getRowHeadElement(row);\n\n        if (th === null) {\n            throw new Error('Cannot find TH element for the Inspector row');\n        }\n\n        var groupLevel = group.getLevel();\n\n        row.setAttribute('data-group-level', groupLevel)\n        th.children[0].style.marginLeft = groupLevel*10 + 'px'\n    }\n\n    Surface.prototype.toggleGroup = function(row, forceExpand) {\n        var link = row.querySelector('a'),\n            groupIndex = row.getAttribute('data-group-index'),\n            table = this.getRootTable(),\n            groupManager = this.getGroupManager(),\n            collapse = true\n\n        if ($.oc.foundation.element.hasClass(link, 'expanded') && !forceExpand) {\n            $.oc.foundation.element.removeClass(link, 'expanded')\n        }","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/assets/foundation/controls/inspector/inspector.surface.js#L387-L423","documentation":"Fires in Surface.prototype.applyGroupLevelToRow when getRowHeadElement(row) returns null for a row created for an Inspector group, so the group level cannot be written to the row head. It indicates the generated table row markup is missing its <th> head cell, usually due to markup/structure drift between the surface renderer and this helper.","triggerScenarios":"Thrown at modules/backend/assets/foundation/controls/inspector/inspector.surface.js:405 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the generated Inspector table markup and ensure each group row contains the expected <th> head element matched by getRowHeadElement","Check for custom CSS/JS or third-party overrides that strip or rename the row head cell","Update or patch getRowHeadElement's selector if the table structure was intentionally changed","Log the row's outerHTML to diagnose which group produces the broken row"],"exampleFix":null,"handlingStrategy":"try-catch","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"}