Fix notice when passing false.

This commit is contained in:
Mark Sch 2018-03-14 17:07:08 +01:00 committed by GitHub
parent 68de980972
commit b68f1cbb1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1566,23 +1566,25 @@ class DboSource extends DataSource {
// Make one pass through children and collect by parent key
// Make second pass through parents and associate children
$mergedByFK = array();
foreach ($assocResultSet as $data) {
$fk = $data[$association][$foreignKey];
if (! array_key_exists($fk, $mergedByFK)) {
$mergedByFK[$fk] = array();
}
if (count($data) > 1) {
$data = array_merge($data[$association], $data);
unset($data[$association]);
foreach ($data as $key => $name) {
if (is_numeric($key)) {
$data[$association][] = $name;
unset($data[$key]);
}
if (is_array($assocResultSet)) {
foreach ($assocResultSet as $data) {
$fk = $data[$association][$foreignKey];
if (! array_key_exists($fk, $mergedByFK)) {
$mergedByFK[$fk] = array();
}
if (count($data) > 1) {
$data = array_merge($data[$association], $data);
unset($data[$association]);
foreach ($data as $key => $name) {
if (is_numeric($key)) {
$data[$association][] = $name;
unset($data[$key]);
}
}
$mergedByFK[$fk][] = $data;
} else {
$mergedByFK[$fk][] = $data[$association];
}
$mergedByFK[$fk][] = $data;
} else {
$mergedByFK[$fk][] = $data[$association];
}
}