octobercms/october · error · ApplicationException

Invalid group interval

Error message

Invalid group interval: {$groupInterval}

What it means

Validation in ReportDataSourceBase::validateDateGroupInterval: the requested group interval string (e.g. day, week, month, quarter, year) is not in the data source's knownGroupIntervals list, so date aggregation cannot be planned.

Solutions

  1. Use one of the GROUP_INTERVAL_* constants
  2. Omit the interval to get the default day grouping on date dimensions
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/dashboard/classes/ReportDataSourceBase.php:271 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/3061d3b06cfdf9fe. Report an issue: GitHub.

Appendix: source

Thrown at modules/dashboard/classes/ReportDataSourceBase.php:271

    /**
     * Validates the specified group interval.
     * @param string $groupInterval Specifies the group interval.
     * @param ReportDimension $dimension Specifies the dimension to group the data by.
     * @return ?string Returns the validated group interval.
     */
    private function validateDateGroupInterval(?string $groupInterval, ReportDimension $dimension): ?string
    {
        if (!$groupInterval && $dimension->isDate()) {
            $groupInterval = self::GROUP_INTERVAL_DAY;
        }

        if ($groupInterval && !$dimension->isDate()) {
            return null;
        }

        if ($groupInterval && !in_array($groupInterval, $this->knownGroupIntervals)) {
            throw new ApplicationException("Invalid group interval: {$groupInterval}");
        }

        return $groupInterval;
    }

    /**
     * assertValidOrderRule
     */
    private function assertValidOrderRule(?ReportDataOrderRule $orderRule, ReportDimension $dimension)
    {
        if ($orderRule && $orderRule->getDataAttributeType() === ReportDataOrderRule::ATTR_TYPE_DIMENSION_FIELD) {
            $dimensionField = $dimension->findDimensionFieldByCode($orderRule->getAttributeName());
            if (!$dimensionField->getIsSortable()) {
                $fieldCode = $dimensionField->getCode();
                throw new ApplicationException("Dimension field {$fieldCode} is not sortable.");
            }
        }
    }

View on GitHub (pinned to b608633a7e)