From daeaca110d16128040c86727c65df225e957f7c6 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 13 Jan 2010 11:27:09 -0800 Subject: Fix for ticket #978. Don't reset the original property as part of the save processing, because that will overwrite the original values with all the new values. The problem with the original approach is that when changed event handlers used ->original(), it had already been reset as part of the save processing. Went back and forth on either leaving this alone and forcing callers to save the original prior to calling the save function, but there were a few event handlers that used ->original(). This seemed the easier change. So to reset the original you need to call reload() or clear(). There is now an optional parameter on the reload to only reload the original. --- modules/gallery/tests/Item_Model_Test.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/gallery/tests/Item_Model_Test.php') diff --git a/modules/gallery/tests/Item_Model_Test.php b/modules/gallery/tests/Item_Model_Test.php index bf5fca1a..c0ac4436 100644 --- a/modules/gallery/tests/Item_Model_Test.php +++ b/modules/gallery/tests/Item_Model_Test.php @@ -166,6 +166,7 @@ class Item_Model_Test extends Unit_Test_Case { $item = self::_create_random_item(); $item->title = "ORIGINAL_VALUE"; $item->save(); + $item->reload(false); $item->title = "NEW_VALUE"; $this->assert_same("ORIGINAL_VALUE", $item->original()->title); -- cgit v1.2.3