diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-08-25 10:05:21 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-08-25 10:05:21 -0700 |
commit | 3ff91e5e33eee7a3f4941a8036c71089d0f2074e (patch) | |
tree | ca856a8fddfdf830524f60d76a9814a9ef9890c4 /modules/gallery | |
parent | 545c069786c1254465ed4fb3054c71e9fdb582db (diff) |
Null out Item_Model::$data_file in Item_Model::save() when we're
creating a new item, else the item_created event will trigger
subsequent saves which will think that they need to post an
item_updated_data_file event. Partial fix for #1286
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/models/item.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index c4591279..1db766e9 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -411,7 +411,9 @@ class Item_Model extends ORM_MPTT { } // This will almost definitely trigger another save, so put it at the end so that we're - // tail recursive. + // tail recursive. Null out the data file variable first, otherwise the next save will + // trigger an item_updated_data_file event. + $this->data_file = null; module::event("item_created", $this); } else { // Update an existing item |