diff options
Diffstat (limited to 'core/models')
| -rw-r--r-- | core/models/item.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/models/item.php b/core/models/item.php index 495508ec..f1a979ee 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -63,11 +63,18 @@ class Item_Model extends ORM_MPTT { $this->lock(); try { $original_path = $this->file_path(); + $original_resize_path = $this->resize_path(); + $original_thumbnail_path = $this->thumbnail_path(); parent::moveTo($target, true); - $new_path = $this->file_path(); - rename($original_path, $new_path); + rename($original_path, $this->file_path()); + if (file_exists($original_resize_path)) { + rename($original_resize_path, $this->resize_path()); + } + if (file_exists($original_thumbnail_path)) { + rename($original_thumbnail_path, $this->thumbnail_path()); + } } catch (Exception $e) { $this->unlock(); |
