From 86f88769f9f636d5fbc75cc39b6f3b78b6ed5893 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 7 Sep 2009 21:30:48 -0700 Subject: Update Item_Model::save() to consider the relative_xxx_cache fields as insignificant, in addition to the view_count field. This means that we won't trigger an event, nor will we adjust the updated field if *only* those fields are changed. --- modules/gallery/models/item.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index a2c49154..0ec5d048 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -349,7 +349,12 @@ class Item_Model extends ORM_MPTT { * @see ORM::save() */ public function save() { - if (!empty($this->changed) && $this->changed != array("view_count" => "view_count")) { + $significant_changes = $this->changed; + unset($significant_changes["view_count"]); + unset($significant_changes["relative_url_cache"]); + unset($significant_changes["relative_path_cache"]); + + if (!empty($this->changed) && $significant_changes) { $this->updated = time(); if (!$this->loaded) { $this->created = $this->updated; -- cgit v1.2.3