octobercms/october · error · ApplicationException

Importing as CSV requires column matches definition

Error message

Importing as CSV requires column matches definition

What it means

Thrown by ImportModel::processImportData when the import format is CSV but no column matches were supplied. CSV imports require an explicit mapping of CSV column indexes to database columns (built in the import UI); without matches the parser cannot build row records.

Solutions

  1. Complete the column-matching step in the import wizard before submitting
  2. Ensure the matches array (column index => db column names) is passed in the import options
  3. For JSON imports, supply data in the expected structure instead of relying on matches
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/models/ImportModel.php:118 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/e00005b3fefb946c. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/models/ImportModel.php:118

     *   [0 => [first_name], 1 => [last_name]]
     *
     * Will return:
     *
     *   [first_name => Joe, last_name => Blogs],
     *   [first_name => Harry, last_name => Potter],
     *   [...]
     *
     * @return array
     */
    protected function processImportData($filePath, $matches, $options)
    {
        // Prepare output
        if ($this->file_format === 'json') {
            $result = $this->processImportDataAsJson($filePath, $matches, $options);
        }
        else {
            if (!$matches) {
                throw new ApplicationException('Importing as CSV requires column matches definition');
            }

            $result = $this->processImportDataAsCsv($filePath, $matches, $options);
        }

        return $result;
    }

    /**
     * decodeArrayValue prepares an array object for the file type.
     * @return array
     */
    protected function decodeArrayValue($value, $delimiter = '|')
    {
        if ($this->file_format === 'json') {
            return $this->decodeArrayValueForJson($value);
        }
        else {

View on GitHub (pinned to b608633a7e)