diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-05 04:56:33 +0000 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-12-05 04:56:33 +0000 |
| commit | 8d1790a0b465566439911c05806afea742148773 (patch) | |
| tree | b258f53c1a60d1e65136c0f2fe0410cf3080714b /core/models | |
| parent | 362f43169c591c62c54a1844889fa04c27774954 (diff) | |
* Add a moveTo unit test
* Pass the module::event(..., $data) by reference to the handlers
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(); |
