{"record":{"id":"10c9b5adfd7ef24e","repo":"octobercms/october","slug":"unknown-dimension-type","errorCode":null,"errorMessage":"Unknown dimension type: ","messagePattern":"Unknown dimension type: ","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/dashboard/classes/ReportDimension.php","lineNumber":134,"sourceCode":"            throw new SystemException('The database column name cannot be empty.');\n        }\n\n        if (!strlen($displayName)) {\n            throw new SystemException('The display name cannot be empty.');\n        }\n\n        $knownTypes = [\n            ReportDimension::TYPE_INDICATOR\n        ];\n\n        $dimensionType = null;\n        $codeParts = explode('@', $code);\n        if (count($codeParts) === 2) {\n            $dimensionType = $codeParts[0];\n        }\n\n        if ($dimensionType !== null && !in_array($dimensionType, $knownTypes)) {\n            throw new SystemException('Unknown dimension type: ' . $dimensionType);\n        }\n\n        $this->code = $code;\n        $this->databaseColumnName = $databaseColumnName;\n        $this->displayName = $displayName;\n        $this->dimensionType = $dimensionType;\n        $this->labelColumnName = $labelColumnName;\n    }\n\n    /**\n     * Adds a field to this dimension.\n     * @param ReportDimensionField $field Specifies the field to add.\n     * @return $this Returns the dimension object for method chaining.\n     */\n    public function addDimensionField(ReportDimensionField $field): ReportDimension\n    {\n        if ($this->isDate()) {\n            throw new SystemException('Date dimensions cannot have fields.');","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/dashboard/classes/ReportDimension.php#L116-L152","documentation":"ReportDimension's constructor parses dimension codes written as 'type@code'. The only recognized type prefix is 'indicator' (ReportDimension::TYPE_INDICATOR); any other prefix segment before the '@' throws a SystemException because no other dimension type is implemented. Codes without '@' (plain dimensions) or with more than one '@' never set a type and never trigger this error.","triggerScenarios":"Constructing a dimension whose code contains exactly one '@' and a non-'indicator' prefix, e.g. new ReportDimension('status@orders', 'id', 'Status') or new ReportDimension('metric@revenue', ...). Note 'a@b@c' (two '@') yields 3 explode parts, so dimensionType stays null and no exception is thrown.","commonSituations":"Typo'd or wrong-case prefixes ('Indicator@', 'indicators@' — the check is case-sensitive), copying a prefix convention from another plugin, or assuming a 'date@' or 'metric@' dimension type exists. Only TYPE_INDICATOR is defined on ReportDimension.","solutions":["Remove the unrecognized prefix and use a plain code such as 'orders' — most dimensions need no type prefix","If you are building an indicator dimension, build the code as ReportDimension::TYPE_INDICATOR . '@yourCode' so the prefix always matches the constant","Check the TYPE_XXX constants on ReportDimension (currently only TYPE_INDICATOR = 'indicator') before composing a prefixed code"],"exampleFix":"// before\n$dimension = new ReportDimension('metric@revenue', 'oc_revenue_id', 'Revenue');\n\n// after (plain dimension, no prefix)\n$dimension = new ReportDimension('revenue', 'oc_revenue_id', 'Revenue');\n\n// or, for an indicator dimension\n$code = ReportDimension::TYPE_INDICATOR . '@revenue';\n$dimension = new ReportDimension($code, 'oc_revenue_id', 'Revenue');","handlingStrategy":"validation","validationCode":"$knownTypes = [ReportDimension::TYPE_INDICATOR]; // extend if new TYPE_XXX appear\n$parts = explode('@', $code);\nif (count($parts) === 2 && !in_array($parts[0], $knownTypes, true)) {\n    throw new InvalidArgumentException(\n        \"Unsupported dimension type '{$parts[0]}'. Use no prefix or one of: \" . implode(', ', $knownTypes)\n    );\n}","typeGuard":"function dimensionCodeHasKnownType(string $code): bool\n{\n    $parts = explode('@', $code);\n    return count($parts) !== 2 || in_array($parts[0], [ReportDimension::TYPE_INDICATOR], true);\n}","tryCatchPattern":null,"preventionTips":["Compose typed dimension codes from the ReportDimension::TYPE_XXX constants instead of string literals","Add a boot-time smoke test that instantiates every dimension your plugin registers","Remember the type check is case-sensitive and only fires when the code contains exactly one '@'"],"tags":["php","dashboard","report","dimension","configuration"],"backgroundTag":"invalid-enum-value","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}