octobercms/october · error · ApplicationException
Unknown column
Error message
Unknown column
What it means
In the same handler, after reading file_column_id, an unknown/nonexistent column id leads to the 'Unknown column' ApplicationException — the posted identifier doesn't match any column detected in the uploaded import file.
Solutions
- Re-upload or re-parse the source file so column ids match the current file
- Ensure the client sends a column id from the most recent file column listing
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/backend/behaviors/importexportcontroller/ActionImport.php:67 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/e70b00232a95ebdf.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/behaviors/importexportcontroller/ActionImport.php:67
$model->import($matches, $importOptions);
$this->vars['importResults'] = $model->getResultStats();
$this->vars['returnUrl'] = $this->getRedirectUrlForType('import');
$this->vars['sourceIndexOffset'] = $this->getImportSourceIndexOffset($importOptions['firstRowTitles']);
}
/**
* actionImportLoadColumnSampleForm
*/
public function actionImportLoadColumnSampleForm()
{
if (($columnId = post('file_column_id', false)) === false) {
throw new ApplicationException(__("Missing column identifier"));
}
$columns = $this->getImportFileColumns();
if (!array_key_exists($columnId, $columns)) {
throw new ApplicationException(__("Unknown column"));
}
$path = $this->getImportFilePath();
if (!$fileFormat = post('file_format', 'json')) {
return null;
}
if ($fileFormat === 'json') {
$data = $this->getImportSampleColumnsFromJson($path, (int) $columnId);
}
else {
$data = $this->getImportSampleColumnsFromCsv($path, (int) $columnId);
}
// Clean up data
foreach ($data as $index => $sample) {
$data[$index] = Str::limit($sample, 100);View on GitHub (pinned to b608633a7e)