From 9ae6acdc0ab3f40fa6267161d733e79d4424eb0b Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 4 Dec 2008 00:14:52 +0000 Subject: Before deleting an item, save the path to the image in the var directory as once the item is deleted, the $item->file_path() is no longer valid. --- core/models/item.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/models/item.php b/core/models/item.php index 211459b9..0f6e16e8 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -40,11 +40,12 @@ class Item_Model extends ORM_MPTT { } public function delete() { + $path = $this->file_path(); parent::delete(); if ($this->is_album()) { - directory::unlink($this->file_path()); + dir::unlink($path); } else { - unlink($this->file_path()); + unlink($path); } } -- cgit v1.2.3