{"record":{"id":"f08df134ab0c2b3c","repo":"phalcon/cphalcon","slug":"column-fieldname-isn-t-part-of-the-column-map","errorCode":null,"errorMessage":"Column '{fieldName}' isn't part of the column map","messagePattern":"Column '(.+?)' isn't part of the column map","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Query\\Exceptions\\PhqlColumnNotInMap","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":1056,"sourceCode":"                    break;\n\n                default:\n                    let insertValue = new RawValue(\n                        dialect->getSqlExpression(exprValue)\n                    );\n\n                    break;\n            }\n\n            let fieldName = fields[number];\n\n            /**\n             * If the user didn't define a column list we assume all the model's\n             * attributes as columns\n             */\n            if automaticFields && typeof columnMap == \"array\" {\n                if unlikely !fetch attributeName, columnMap[fieldName] {\n                    throw new PhqlColumnNotInMap(fieldName);\n                }\n            } else {\n                let attributeName = fieldName;\n            }\n\n            let insertValues[attributeName] = insertValue;\n        }\n\n        /**\n         * Get model from the Models Manager\n         */\n        let insertModel = manager->load(modelName);\n\n        insertModel->assign(insertValues);\n\n        /**\n         * Call 'create' to ensure that an insert is performed\n         * Return the insert status","sourceCodeStart":1038,"sourceCodeEnd":1074,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L1038-L1074","documentation":"In prepareInsert(), when column renaming (orm.column_renaming) is active and no explicit field list is given, each field must exist in the model's column map; an unknown field name raises this PhqlColumnDoesNotExist-style error. The faulty input is a column name in the INSERT that is neither an attribute nor present in columnMap().","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:1056 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the model attribute name, not the physical column name, in the PHQL INSERT","Add the missing entry to the model's columnMap()","Disable column renaming or align naming conventions"],"exampleFix":"INSERT INTO Robots (theName) VALUES (:name:) -- where columnMap maps 'theName'","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reference attributes via model constants or builder columns()","Keep columnMap() complete and generated from the schema"],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}