TranslateBehavior now uses original atomic option value, if set

This commit is contained in:
Ceeram 2014-10-10 14:17:16 +02:00
parent 7b44d5d7a3
commit 1dfd3405a4

View file

@ -437,6 +437,10 @@ class TranslateBehavior extends ModelBehavior {
$tempData = $this->_prepareTranslations($Model, $tempData);
}
$locale = $this->_getLocale($Model);
$atomic = array();
if (isset($options['atomic'])) {
$atomic = array('atomic' => $options['atomic']);
}
foreach ($tempData as $field => $value) {
unset($conditions['content']);
@ -466,10 +470,11 @@ class TranslateBehavior extends ModelBehavior {
$RuntimeModel->save(array(
$RuntimeModel->alias => array_merge(
$conditions, array('id' => $translations[$_locale])
)
),
$atomic
));
} else {
$RuntimeModel->save(array($RuntimeModel->alias => $conditions));
$RuntimeModel->save(array($RuntimeModel->alias => $conditions), $atomic);
}
}
}