mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
updating translate recursive handling, fixes #5593
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7823 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
f2823e85d7
commit
e2a5f38b36
1 changed files with 9 additions and 7 deletions
|
@ -115,14 +115,16 @@ class TranslateBehavior extends ModelBehavior {
|
|||
if (empty($query['fields'])) {
|
||||
$query['fields'] = array($model->alias.'.*');
|
||||
|
||||
foreach (array('hasOne', 'belongsTo') as $type) {
|
||||
foreach ($model->{$type} as $key => $value) {
|
||||
if ($model->recursive >= 0) {
|
||||
foreach (array('hasOne', 'belongsTo') as $type) {
|
||||
foreach ($model->{$type} as $key => $value) {
|
||||
|
||||
if (empty($value['fields'])) {
|
||||
$query['fields'][] = $key.'.*';
|
||||
} else {
|
||||
foreach ($value['fields'] as $field) {
|
||||
$query['fields'][] = $key.'.'.$field;
|
||||
if (empty($value['fields'])) {
|
||||
$query['fields'][] = $key.'.*';
|
||||
} else {
|
||||
foreach ($value['fields'] as $field) {
|
||||
$query['fields'][] = $key.'.'.$field;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue