octobercms/october · error · ApplicationException

There was no data supplied to export

Error message

There was no data supplied to export

What it means

Thrown by ExportModel::processExportData when the data source to export resolves to an empty/falsy result set. It is a pre-flight validation guard before CSV compilation: exporting zero rows is treated as a misconfigured or exhausted export rather than producing an empty file.

Solutions

  1. Ensure the export data query actually returns rows (check filters/conditions)
  2. Verify the export columns and data provider are configured for the model in use
  3. Loosen or fix the applied export filters that may be excluding all records
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/models/ExportModel.php:123 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/e6cd8def26396e1b. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/models/ExportModel.php:123

     * the expected output format is [column_name => Column Label]
     */
    protected function processColumnKeys(array $columns): array
    {
        if (Arr::isList($columns)) {
            $columns = array_combine($columns, $columns);
        }

        return $columns;
    }

    /**
     * processExportData converts a data collection to a CSV file.
     */
    protected function processExportData($columns, $results, $options)
    {
        // Validate
        if (!$results) {
            throw new ApplicationException(__("There was no data supplied to export"));
        }

        // Extend columns
        $columns = $this->exportExtendColumns($columns);

        // Save for download
        $fileName = uniqid('oc');

        // Prepare export
        if ($this->file_format === 'json') {
            $dataFileName = $fileName . 'xjson';
            $options['savePath'] = $this->getTemporaryExportPath($dataFileName);
            $this->processExportDataAsJson($columns, $results, $options);
        }
        else {
            $dataFileName = $fileName . 'xcsv';
            $options['savePath'] = $this->getTemporaryExportPath($dataFileName);
            $this->processExportDataAsCsv($columns, $results, $options);

View on GitHub (pinned to b608633a7e)