octobercms/october · error · ApplicationException

Attribute name cannot be empty for

Error message

Attribute name cannot be empty for 

What it means

Error "Attribute name cannot be empty for " thrown in octobercms/october.

Source

Thrown at modules/dashboard/classes/ReportDataOrderRule.php:40

     * One of the ATTR_TYPE_* constants.
     * @param string $attributeName Specifies the attribute name, e.g. a metric code.
     * Must not be null if the data attribute type is ATTR_TYPE_DIMENSION_FIELD or ATTR_TYPE_METRIC.
     * Must be null if the data attribute type is ATTR_TYPE_DIMENSION.
     * @param bool $isAscending Specifies if the order is ascending or descending.
     */
    public function __construct(string $dataAttributeType, ?string $attributeName = null, bool $isAscending = true)
    {
        $knownAttributeTypes = [
            self::ATTR_TYPE_DIMENSION,
            self::ATTR_TYPE_METRIC,
            self::ATTR_TYPE_DIMENSION_FIELD
        ];
        if (!in_array($dataAttributeType, $knownAttributeTypes)) {
            throw new ApplicationException('Invalid data attribute type. Supported types: ' . implode(', ', $knownAttributeTypes));
        }

        if (!$attributeName && $dataAttributeType !== self::ATTR_TYPE_DIMENSION) {
            throw new ApplicationException('Attribute name cannot be empty for ' . $dataAttributeType . ' data attribute type.');
        }

        if ($attributeName && $dataAttributeType === self::ATTR_TYPE_DIMENSION) {
            throw new ApplicationException('Attribute name must be empty for ' . self::ATTR_TYPE_DIMENSION . ' data attribute type.');
        }

        if ($dataAttributeType === self::ATTR_TYPE_DIMENSION_FIELD) {
            ReportDimensionField::validateCode($attributeName);
        }

        $this->dataAttributeType = $dataAttributeType;
        $this->attributeName = $attributeName;
        $this->isAscending = $isAscending;
    }

    /**
     * Creates the order rule from a widget configuration.
     * @param string $sortOrder Specifies the sort order, the allowed values are "asc", "desc".

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/dashboard/classes/ReportDataOrderRule.php:40 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/96e378cbfed5994c. Report an issue: GitHub.