Skip to content

Commit

Permalink
making a backup of model virtual fields in traslate behavrio to avoid…
Browse files Browse the repository at this point in the history
… side effects
  • Loading branch information
lorenzo committed Oct 26, 2010
1 parent f94f79e commit e989f71
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cake/libs/model/behaviors/translate.php
Expand Up @@ -87,6 +87,7 @@ public function cleanup(&$model) {
* @return array Modified query
*/
public function beforeFind(&$model, $query) {
$this->runtime[$model->alias]['virtualFields'] = $model->virtualFields;
$locale = $this->_getLocale($model);
if (empty($locale)) {
return $query;
Expand Down Expand Up @@ -128,6 +129,7 @@ public function beforeFind(&$model, $query) {
}
}

$this->runtime[$model->alias]['virtualFields'] = $model->virtualFields;
if ($addFields) {
foreach ($addFields as $field) {
// foreach (array($field, $model->alias.'.'.$field) as $_field) {
Expand Down

0 comments on commit e989f71

Please sign in to comment.