mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 13:02:40 +00:00
Adding fix for Ticket #2232.
Added tests for ticket git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4714 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
41012b86ba
commit
3a62793d0e
3 changed files with 254 additions and 232 deletions
|
@ -787,7 +787,23 @@ class DboSource extends DataSource {
|
|||
$data[$association] = $merge[0][$association];
|
||||
} else {
|
||||
if(is_array($merge[0][$association])){
|
||||
$data[$association] = array_merge($merge[0][$association], $data[$association]);
|
||||
foreach ($data[$association] as $k => $v) {
|
||||
if(!is_array($v)){
|
||||
$dataAssocTmp[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($merge[0][$association] as $k => $v) {
|
||||
if(!is_array($v)){
|
||||
$mergeAssocTmp[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if ($mergeAssocTmp == $dataAssocTmp) {
|
||||
$data[$association] = array_merge($merge[0][$association], $data[$association]);
|
||||
} else {
|
||||
$data[$association][$association] = $merge[0][$association];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -830,7 +846,7 @@ class DboSource extends DataSource {
|
|||
|
||||
if (!isset($queryData['selfJoin'])) {
|
||||
$queryData['selfJoin'] = array();
|
||||
|
||||
|
||||
$self = array(
|
||||
'fields' => $this->fields($model, null, $queryData['fields']),
|
||||
'joins' => array(array(
|
||||
|
@ -846,7 +862,7 @@ class DboSource extends DataSource {
|
|||
'conditions'=> $queryData['conditions'],
|
||||
'order' => $queryData['order']
|
||||
);
|
||||
|
||||
|
||||
if (!empty($queryData['joins'])) {
|
||||
foreach($queryData['joins'] as $join) {
|
||||
$self['joins'][] = $join;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue