{"record":{"id":"e00005b3fefb946c","repo":"octobercms/october","slug":"importing-as-csv-requires-column-matches-definitio","errorCode":null,"errorMessage":"Importing as CSV requires column matches definition","messagePattern":"Importing as CSV requires column matches definition","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/backend/models/ImportModel.php","lineNumber":118,"sourceCode":"     *   [0 => [first_name], 1 => [last_name]]\n     *\n     * Will return:\n     *\n     *   [first_name => Joe, last_name => Blogs],\n     *   [first_name => Harry, last_name => Potter],\n     *   [...]\n     *\n     * @return array\n     */\n    protected function processImportData($filePath, $matches, $options)\n    {\n        // Prepare output\n        if ($this->file_format === 'json') {\n            $result = $this->processImportDataAsJson($filePath, $matches, $options);\n        }\n        else {\n            if (!$matches) {\n                throw new ApplicationException('Importing as CSV requires column matches definition');\n            }\n\n            $result = $this->processImportDataAsCsv($filePath, $matches, $options);\n        }\n\n        return $result;\n    }\n\n    /**\n     * decodeArrayValue prepares an array object for the file type.\n     * @return array\n     */\n    protected function decodeArrayValue($value, $delimiter = '|')\n    {\n        if ($this->file_format === 'json') {\n            return $this->decodeArrayValueForJson($value);\n        }\n        else {","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/models/ImportModel.php#L100-L136","documentation":"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.","triggerScenarios":"Thrown at modules/backend/models/ImportModel.php:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Complete the column-matching step in the import wizard before submitting","Ensure the matches array (column index => db column names) is passed in the import options","For JSON imports, supply data in the expected structure instead of relying on matches"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","contentChangedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}