{"record":{"id":"5345e6dc5068dbae","repo":"phalcon/cphalcon","slug":"unknown-join-type-type-when-preparing-phql","errorCode":null,"errorMessage":"Unknown join type {type}, when preparing: {phql}","messagePattern":"Unknown join type (.+?), when preparing: (.+?)","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Query\\Exceptions\\UnknownJoinType","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":2562,"sourceCode":"\n        switch type {\n            case PHQL_T_INNERJOIN:\n                return \"INNER\";\n\n            case PHQL_T_LEFTJOIN:\n                return \"LEFT\";\n\n            case PHQL_T_RIGHTJOIN:\n                return \"RIGHT\";\n\n            case PHQL_T_CROSSJOIN:\n                return \"CROSS\";\n\n            case PHQL_T_FULLJOIN:\n                return \"FULL OUTER\";\n        }\n\n        throw new UnknownJoinType(type, this->phql);\n    }\n\n    /**\n     * Processes the JOINs in the query returning an internal representation for\n     * the database dialect\n     */\n    final protected function getJoins(array select) -> array\n    {\n        var models, sqlAliases, sqlAliasesModels, sqlModelsAliases,\n            sqlAliasesModelsInstances, modelsInstances, fromModels,\n            manager, selectJoins, joinItem, joins, joinData, schema, source,\n            model, realModelName, completeSource, joinType, aliasExpr, alias,\n            joinAliasName, joinExpr, fromModelName, joinAlias, joinModel,\n            joinSource, preCondition, modelNameAlias, relation, relations,\n            modelAlias, sqlJoin, sqlJoinItem, selectTables, tables, tableItem;\n        array sqlJoins, joinModels, joinSources, joinTypes, joinPreCondition,\n            joinPrepared;\n","sourceCodeStart":2544,"sourceCodeEnd":2580,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L2544-L2580","documentation":"Thrown by Query::getJoinType when the join item's type token does not match any known join constant (INNER, LEFT, RIGHT, CROSS, FULL), meaning the PHQL parser emitted an unrecognized join type for this statement.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:2562 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the join keyword in the PHQL is one of INNER/LEFT/RIGHT/CROSS/FULL JOIN.","Rewrite unsupported join syntax (e.g. NATURAL JOIN) using standard joins.","Catch and log the PHQL plus join type; check for framework version mismatches."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"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"}