octobercms/october · error · ApplicationException

Invalid metric column name:

Error message

Invalid metric column name: 

What it means

Error "Invalid metric column name: " thrown in octobercms/october.

Source

Thrown at modules/dashboard/classes/ReportDateDataSet.php:291

            $function = $metric->getAggregateFunction();
            $result[$metric->getDataSetColumName()] = $function;
        }

        return $result;
    }

    private function addMetricValuesToAggregationSet(
        object $aggregationSet,
        array $columnNames,
        array $metricAggregateFunctions,
        object $dataPoint
    ) {
        foreach ($columnNames as $columnName) {
            $aggregatedValue = $aggregationSet->$columnName;
            $metricValue = $dataPoint->$columnName;

            if (!array_key_exists($columnName, $metricAggregateFunctions)) {
                throw new ApplicationException('Invalid metric column name: '.$columnName);
            }

            $aggregateFunction = $metricAggregateFunctions[$columnName];
            switch ($aggregateFunction) {
                case ReportMetric::AGGREGATE_COUNT:
                    if ($metricValue !== null) {
                        $aggregatedValue = $aggregatedValue === null ? 1 : $aggregatedValue + 1;
                    }
                    break;
                case ReportMetric::AGGREGATE_MAX:
                        $aggregatedValue = $aggregatedValue === null ? $metricValue : max($aggregatedValue, $metricValue);
                    break;
                case ReportMetric::AGGREGATE_MIN:
                        $aggregatedValue = $aggregatedValue === null ? $metricValue : min($aggregatedValue, $metricValue);
                    break;
                case ReportMetric::AGGREGATE_SUM:
                        $aggregatedValue = $aggregatedValue === null ? $metricValue : $aggregatedValue + $metricValue;
                    break;

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/dashboard/classes/ReportDateDataSet.php:291 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/d145da9e70780c28. Report an issue: GitHub.