mirror of
https://github.com/Pathduck/gallery3.git
synced 2024-10-29 21:07:18 -04:00
Merge pull request #448 from shadlaws/fix_2077_master
Move "item_moved" event later in the item update process. Fixes #2077.
This commit is contained in:
commit
88eeccb126
@ -63,11 +63,6 @@ class item_Core {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If the target has no cover item, make this it.
|
||||
if ($target->album_cover_item_id == null) {
|
||||
item::make_album_cover($source);
|
||||
}
|
||||
}
|
||||
|
||||
static function make_album_cover($item) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user