Commit 48876791 by Carsten Brandt

do not remove records that have no primary key selected

this problem occurs when joining active record but not selecting the primary key field. records get populated but they do not have primary key value populated which results in only one record left over in the result.
parent de32f414
...@@ -159,7 +159,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface ...@@ -159,7 +159,7 @@ class ActiveQuery extends Query implements ActiveQueryInterface
$key = $model[$pk]; $key = $model[$pk];
if (isset($hash[$key])) { if (isset($hash[$key])) {
unset($models[$i]); unset($models[$i]);
} else { } elseif ($key !== null) {
$hash[$key] = true; $hash[$key] = true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment