Skip to content

Commit

Permalink
Merge branch 'master' into 2.0
Browse files Browse the repository at this point in the history
Conflicts:
	cake/libs/controller/components/request_handler.php
	cake/libs/view/pages/home.ctp
	cake/libs/view/view.php
	cake/tests/cases/libs/view/view.test.php
	lib/Cake/Cache/Engine/FileEngine.php
	lib/Cake/Config/config.php
	lib/Cake/Console/cake
	lib/Cake/Model/Behavior/TranslateBehavior.php
	lib/Cake/VERSION.txt
  • Loading branch information
lorenzo committed Oct 16, 2011
2 parents f8aa9e0 + 924fb6f commit 7c5352a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions cake/tests/test_app/views/elements/test_element.xml
@@ -0,0 +1 @@
<p>test element</p>
11 changes: 3 additions & 8 deletions lib/Cake/Model/Behavior/TranslateBehavior.php
Expand Up @@ -169,21 +169,16 @@ public function beforeFind($model, $query) {
$query['fields'][] = 'i18n_'.$field;
}
$query['joins'][] = array(
'type' => 'LEFT',
'type' => 'INNER',
'alias' => 'I18n__'.$field,
'table' => $joinTable,
'conditions' => array(
$model->alias . '.' . $model->primaryKey => $db->identifier("I18n__{$field}.foreign_key"),
'I18n__'.$field.'.model' => $model->name,
'I18n__'.$field.'.'.$RuntimeModel->displayField => $aliasField
'I18n__'.$field.'.'.$RuntimeModel->displayField => $field,
'I18n__'.$field.'.locale' => $locale
)
);

if (is_string($query['conditions'])) {
$query['conditions'] = $db->conditions($query['conditions'], true, false, $model) . ' AND '.$db->name('I18n__'.$field.'.locale').' = \''.$locale.'\'';
} else {
$query['conditions'][$db->name("I18n__{$field}.locale")] = $locale;
}
}
}
}
Expand Down

0 comments on commit 7c5352a

Please sign in to comment.