{"record":{"id":"96e378cbfed5994c","repo":"octobercms/october","slug":"attribute-name-cannot-be-empty-for","errorCode":null,"errorMessage":"Attribute name cannot be empty for ","messagePattern":"Attribute name cannot be empty for ","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/dashboard/classes/ReportDataOrderRule.php","lineNumber":40,"sourceCode":"     * One of the ATTR_TYPE_* constants.\n     * @param string $attributeName Specifies the attribute name, e.g. a metric code.\n     * Must not be null if the data attribute type is ATTR_TYPE_DIMENSION_FIELD or ATTR_TYPE_METRIC.\n     * Must be null if the data attribute type is ATTR_TYPE_DIMENSION.\n     * @param bool $isAscending Specifies if the order is ascending or descending.\n     */\n    public function __construct(string $dataAttributeType, ?string $attributeName = null, bool $isAscending = true)\n    {\n        $knownAttributeTypes = [\n            self::ATTR_TYPE_DIMENSION,\n            self::ATTR_TYPE_METRIC,\n            self::ATTR_TYPE_DIMENSION_FIELD\n        ];\n        if (!in_array($dataAttributeType, $knownAttributeTypes)) {\n            throw new ApplicationException('Invalid data attribute type. Supported types: ' . implode(', ', $knownAttributeTypes));\n        }\n\n        if (!$attributeName && $dataAttributeType !== self::ATTR_TYPE_DIMENSION) {\n            throw new ApplicationException('Attribute name cannot be empty for ' . $dataAttributeType . ' data attribute type.');\n        }\n\n        if ($attributeName && $dataAttributeType === self::ATTR_TYPE_DIMENSION) {\n            throw new ApplicationException('Attribute name must be empty for ' . self::ATTR_TYPE_DIMENSION . ' data attribute type.');\n        }\n\n        if ($dataAttributeType === self::ATTR_TYPE_DIMENSION_FIELD) {\n            ReportDimensionField::validateCode($attributeName);\n        }\n\n        $this->dataAttributeType = $dataAttributeType;\n        $this->attributeName = $attributeName;\n        $this->isAscending = $isAscending;\n    }\n\n    /**\n     * Creates the order rule from a widget configuration.\n     * @param string $sortOrder Specifies the sort order, the allowed values are \"asc\", \"desc\".","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/dashboard/classes/ReportDataOrderRule.php#L22-L58","documentation":"Error \"Attribute name cannot be empty for \" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/dashboard/classes/ReportDataOrderRule.php:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}