{"record":{"id":"ad7e48bc6aaebe51","repo":"octobercms/october","slug":"attribute-name-must-be-empty-for","errorCode":null,"errorMessage":"Attribute name must be empty for ","messagePattern":"Attribute name must be empty for ","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/dashboard/classes/ReportDataOrderRule.php","lineNumber":44,"sourceCode":"     * @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\".\n     * @param string $sortBy Specifies the data attribute type and code, e.g. \"oc_dimension\" or \"oc_metric-[metric-code]\"\n     */\n    public static function createFromWidgetConfig(string $sortOrder, string $sortBy)\n    {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/dashboard/classes/ReportDataOrderRule.php#L26-L62","documentation":"Error \"Attribute name must be empty for \" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/dashboard/classes/ReportDataOrderRule.php:44 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"}