From c46188111015a128ac4ffa1882a63924cd49b25e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 19 Jul 2009 13:20:08 -0700 Subject: Don't post the item_updated() event if we're just updating the view count. --- modules/gallery/models/item.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/gallery/models') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 05c4e656..129bd77f 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -353,11 +353,12 @@ class Item_Model extends ORM_MPTT { $this->created = $this->updated; $r = ORM::factory("item")->select("MAX(weight) as max_weight")->find(); $this->weight = $r->max_weight + 1; - $created = 1; + } else { + $send_event = 1; } } parent::save(); - if (!isset($created)) { + if (isset($send_event)) { module::event("item_updated", $this); } return $this; -- cgit v1.2.3