{"record":{"id":"8557984074f0019d","repo":"yiisoft/yii2","slug":"a-join-clause-must-be-specified-as-an-array-of-joi","errorCode":null,"errorMessage":"A join clause must be specified as an array of join type, join table, and optionally join condition.","messagePattern":"A join clause must be specified as an array of join type, join table, and optionally join condition\\.","errorType":"exception","errorClass":"yii\\db\\Exception","httpStatus":null,"severity":"error","filePath":"framework/db/QueryBuilder.php","lineNumber":1306,"sourceCode":"\n        return 'FROM ' . implode(', ', $tables);\n    }\n\n    /**\n     * @param array $joins\n     * @param array $params the binding parameters to be populated\n     * @return string the JOIN clause built from [[Query::$join]].\n     * @throws Exception if the $joins parameter is not in proper format\n     */\n    public function buildJoin($joins, &$params)\n    {\n        if (empty($joins)) {\n            return '';\n        }\n\n        foreach ($joins as $i => $join) {\n            if (!is_array($join) || !isset($join[0], $join[1])) {\n                throw new Exception('A join clause must be specified as an array of join type, join table, and optionally join condition.');\n            }\n            // 0:join type, 1:join table, 2:on-condition (optional)\n            list($joinType, $table) = $join;\n            $tables = $this->quoteTableNames((array)$table, $params);\n            $table = reset($tables);\n            $joins[$i] = \"$joinType $table\";\n            if (isset($join[2])) {\n                $condition = $this->buildCondition($join[2], $params);\n                if ($condition !== '') {\n                    $joins[$i] .= ' ON ' . $condition;\n                }\n            }\n        }\n\n        return implode($this->separator, $joins);\n    }\n\n    /**","sourceCodeStart":1288,"sourceCodeEnd":1324,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/db/QueryBuilder.php#L1288-L1324","documentation":"Error \"A join clause must be specified as an array of join type, join table, and optionally join condition.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/db/QueryBuilder.php:1306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}