diff options
| author | Shad Laws <shad@shadlaws.com> | 2013-07-08 00:46:00 -0700 |
|---|---|---|
| committer | Shad Laws <shad@shadlaws.com> | 2013-07-08 00:46:00 -0700 |
| commit | 88eeccb126e9acf94eb0927f349c16fc11211260 (patch) | |
| tree | d0e555d3a1fb9a974e6fbb6306ee5c889054e591 /modules/gallery/models | |
| parent | 188209446094b3521100d51587456053689080ce (diff) | |
| parent | d0aef95a657c9e50fe255ca912bb01b7c3b74c2e (diff) | |
Merge pull request #448 from shadlaws/fix_2077_master
Move "item_moved" event later in the item update process. Fixes #2077.
Diffstat (limited to 'modules/gallery/models')
| -rw-r--r-- | modules/gallery/models/item.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 1d4f35da..2dbd99bb 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -498,11 +498,6 @@ class Item_Model_Core extends ORM_MPTT { @rename($original->resize_path(), $this->resize_path()); @rename($original->thumb_path(), $this->thumb_path()); } - - if ($original->parent_id != $this->parent_id) { - // This will result in 2 events since we'll still fire the item_updated event below - module::event("item_moved", $this, $original->parent()); - } } // Changing the name, slug or parent ripples downwards @@ -526,6 +521,11 @@ class Item_Model_Core extends ORM_MPTT { $this->resize_dirty = 1; } + if ($original->parent_id != $this->parent_id) { + // This will result in 2 events since we'll still fire the item_updated event below + module::event("item_moved", $this, $original->parent()); + } + module::event("item_updated", $original, $this); if ($this->data_file) { |
