summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-09-07 21:30:48 -0700
committerBharat Mediratta <bharat@menalto.com>2009-09-07 21:30:48 -0700
commit86f88769f9f636d5fbc75cc39b6f3b78b6ed5893 (patch)
treee6783843c86d1e719a1b03e2453c6d17baa14b24 /modules
parent78a42d9b8397e36bdd2a84e1fd6b4f49f0873b78 (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/models/item.php7
1 files changed, 6 insertions, 1 deletions
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;