From 52245a059f1f28c5dd5b626e5cca031b0db1814e Mon Sep 17 00:00:00 2001 From: the_undefined Date: Thu, 15 May 2008 04:00:21 +0000 Subject: [PATCH] Closes #4156 git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6878 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/behaviors/translate.php | 3 +-- cake/tests/cases/libs/model/behaviors/translate.test.php | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/behaviors/translate.php b/cake/libs/model/behaviors/translate.php index f90209614..c4ab14a8b 100644 --- a/cake/libs/model/behaviors/translate.php +++ b/cake/libs/model/behaviors/translate.php @@ -221,9 +221,8 @@ class TranslateBehavior extends ModelBehavior { /** * Callback */ - function beforeSave(&$model) { + function beforeValidate(&$model) { $locale = $this->_getLocale($model); - if (empty($locale)) { return true; } diff --git a/cake/tests/cases/libs/model/behaviors/translate.test.php b/cake/tests/cases/libs/model/behaviors/translate.test.php index 0f601a05d..173e873f7 100644 --- a/cake/tests/cases/libs/model/behaviors/translate.test.php +++ b/cake/tests/cases/libs/model/behaviors/translate.test.php @@ -378,6 +378,7 @@ class TranslateTest extends CakeTestCase { function testMultipleUpdate() { $this->Model->locale = 'eng'; + $this->Model->validate['title'] = VALID_NOT_EMPTY; $data = array('TranslatedItem' => array( 'id' => 1, 'title' => array('eng' => 'New Title #1', 'deu' => 'Neue Titel #1', 'cze' => 'Novy Titulek #1'),