From 17f9d1380dee94fd040b2a4c8ee9509f3fc7a72c Mon Sep 17 00:00:00 2001 From: Walther Lalk Date: Mon, 15 Aug 2016 10:00:20 +0200 Subject: [PATCH] Do not forget the target table column types --- src/ORM/Association/BelongsToMany.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ORM/Association/BelongsToMany.php b/src/ORM/Association/BelongsToMany.php index 201e4821a02..41b616093a7 100644 --- a/src/ORM/Association/BelongsToMany.php +++ b/src/ORM/Association/BelongsToMany.php @@ -1272,7 +1272,8 @@ protected function _buildQuery($options) $query ->where($this->junctionConditions()) ->select($joinFields) - ->defaultTypes($types); + ->defaultTypes($types) + ->addDefaultTypes($this->target()); $query ->eagerLoader()